atom feed3 messages in ru.sysoev.nginxTrailing slash being removed from doc...
FromSent OnAttachments
freejackJan 4, 2012 2:29 pm 
Francis DalyJan 4, 2012 2:56 pm 
freejackJan 4, 2012 3:15 pm 
Subject:Trailing slash being removed from document root
From:freejack (ngin@nginx.us)
Date:Jan 4, 2012 2:29:59 pm
List:ru.sysoev.nginx

Hi all. We're considering switching from lighttpd to nginx in my company and so far everything looks good except for one thing I can't seem to figure out.

When getting the document root in PHP from nginx using this:

$_SERVER['DOCUMENT_ROOT']."../".$ZONE."/".$LOCALE...etc......

nginx will always return the path WITHOUT the trailing slash. I have the document root configured like this:

root /home/web/www.site.com/html/; # note the trailing slash

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?

Thanks!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,220811,220811#msg-220811