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:

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]