Welcome! Log In Create A New Profile

Advanced

Problem with query string parameters

Posted by Murena 
Problem with query string parameters
April 20, 2011 04:37AM
Hello,

I'm converting a symfony php web application from apache to symfony. Everything works for now except this case (worked on apache):

When the url is something like:

http://www.example.xxx/panel/?search=2424
( the ? is after a slash)

the $_SERVER['QUERY_STRING'] is empty and also $_SERVER['QUERY_STRING'] is set to no value.

This is my configuration:

location / {
try_files $uri /index.php;
}

location ~ "^(.+\.php)($|/)" {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(.*)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}

Is it possible to make it work?
Thanks.
Re: Problem with query string parameters
April 20, 2011 04:53AM
I discovered that the problem is not related to /? part. The query string is empty also in

http://www.example.xxx/panel?search=2424

But if I write

http://www.example.xxx/index.php/panel?search=2424

the query_string is ok.

Is my setup wrong?
Re: Problem with query string parameters
April 20, 2011 07:47AM
Ok i just found out that try_files

"Unlike rewrite, $args are not automatically preserved if the fallback is not a named location."

It seems I've fixed the problem.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready