Answer the question
In order to leave comments, you need to log in
Why doesn't Nginx see query parameters in the CNC?
The host says: try_files $uri $uri/ /index.php;
For example, the path is specified in the router: ajax, which in turn is correctly processed, but there is a problem, if we access it like this: /ajax?do=test, then the $_GET variable is not filled with data...
Actually, everything works under the apache2 daemon , under nginx I encountered such a problem, nginx processes the entire address bar as one, how to make it process it correctly? Like, everything after [?] is query parameters...
Host parameters:
listen 80;
root /var/www/domain.ru/htdocs;
index index.php;
server_name domain.ru;
autoindex off;
location ~ "\.php$" {
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ "\.[0-9]{2,3}x[0-9]{2,3}\.(jp[e]*g|png|gif)$" {
try_files $uri $uri/ /image.php;
}
location / {
try_files $uri $uri/ /index.php;
}
Answer the question
In order to leave comments, you need to log in
Try adding $query_stringtry_files $uri $uri/ /index.php?$query_string;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question