Native variable for one level above $document_root?

At the nginx vhost level, is there a native nginx value similar to
$document_root for one directory level above $document_root ?

for example if $document_root = /home/username/public or
/home/username2/public

is there a variable I can reference at nginx vhost level that references
/home/username or /home/username2 ?

thanks

George

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

On Sat, Mar 07, 2015 at 04:26:00PM -0500, George wrote:

Hi there,

At the nginx vhost level, is there a native nginx value similar to
$document_root for one directory level above $document_root ?

Probably not; but you can use “map” to make your own.

For example:

map $document_root $the_thing_that_you_want {
default “”;
~(?P.*)/. $it;
}

http://nginx.org/r/map

Then use $the_thing_that_you_want.

Be aware of the time at which the variable gets its value.

f

Francis D. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs