nginx will always return the path WITHOUT the trailing slash.
nginx doesn't do PHP, it does fastcgi. Which means that it sends a series
of key/value params to the fastcgi server, which in turn presents them
to your PHP in the _SERVER array.
Which in turn means that...
We have way too much code in php that gets the document root without
adding a trailing slash after $_SERVER['DOCUMENT_ROOT'] because lighttpd
and apache before that always had preserved the trailing slash.
How can I configure nginx to keep the slash?
...wherever you currently set "fastcgi_param DOCUMENT_ROOT" (probably from
"include fastcgi.conf"), add the slash there and it all should Just Work.
you probably have
fastcgi_param DOCUMENT_ROOT $document_root;
Change it to be
fastcgi_param DOCUMENT_ROOT $document_root/;
and on nginx -s reload, you should see the difference.