I have something funky going on with my NGINX configuration for Wordpress. Here's what it looks like:
location /home {
root /var/www/html/home;
try_files $uri $uri/ /home/index.php?$args /home/index.php?q=$1;
}
location ~ home\/.*\.php$ {
root /var/www/html/home;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Now if I navigate to: https://example.com/home/cart/?ec_page=checkout_info and inspect the $_REQUEST and $_SERVER automatic variables I get this apparent inconsistency that:
print_r($_REQUEST) has [REQUEST_URI] => /home/cart/?ec_page=checkout_info
print_r($_GET) has [q] =>
So it seems "obvious" to me that somehow my NGINX configuration isn't invoking PHP correctly so that $_GET is popolated with [ec_page] => checkout_info, and having stared at my NGINX rules, I kind of see it must be because /home/index.php?$args resolves to /home/index.php?/cart/?ec_page=checkout_info or some such nonsense, that results in a 404 error, which consequently delegates to /home/index.php?q=$1 and $1 is apparently empty.
What is the correct way to do this? I don't think this matters, but for what it's worth the trouble I'm running into here is related to the wp-easycart plugin, and my wordpress site is configured for Post name Permalinks (which I don't want to change). If I do change the Permalinks setting of Wordpress to Plain then the NGINX configuration above seems to work, but only because that effectively uses changes the way the URLs so that there are no route parameters and everything becomes a querystring parameter.
/var/www/html/homebut you also want/homein your URLs?