I'm trying to setup a location directive in nginx with an exact URI match of the form: http://host/authenticate/?username=test&password=test. I have a script called, index.php located in the public folder, /usr/share/nginx/html/authenticate/ which should process the query parameters that are sent. When I try a URI of the form http://host/authenticate/, my php script (index.php) processes the request. However, if the URI contains query parameters, http://host/authenticate/?username=blah&password=blah then I get 404 Not Found instead of index.php processing the request. Any thoughts on what I am doing wrong?
Much appreciated.
location = /authenticate/ {
index index.php;
try_files $uri $uri/index.php$is_args$query_string =404;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param USERNAME $arg_username;
fastcgi_param PASSWORD $arg_password;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/authenticate/index.php;
include fastcgi_params;
}