I'm running into a strange issue where the $_GET
(and $_REQUEST
) variable is empty, even though the parameters are being passed.
My PHP code:
echo $_SERVER['REQUEST_URI'];
echo print_r($_REQUEST);
echo print_r($_GET);
Output:
/service/getAllOrders?sortBy=date_created&sortDir=desc
Array()
Array()
I'm using nginx and forwarding all requests to index.php. My configuration is as follows:
server {
listen 80;
server_name decaro.localhost;
root /Users/rweiss/Sites/decaro/LocalOrderWebsite;
#access_log /usr/local/etc/nginx/logs/default.access.log main;
location / {
add_header Cache-Control "no-cache, no-store";
include /usr/local/etc/nginx/conf.d/php-fpm;
try_files $uri $uri/ /index.php$args;
}
location /assets/ {
allow all;
}
location = /info {
allow 127.0.0.1;
deny all;
rewrite (.*) /.info.php;
}
error_page 404 /404.html;
error_page 403 /403.html;
}
Why?