Welcome! Log In Create A New Profile

Advanced

Re: native variable for one level above $document_root ?

Francis Daly
March 07, 2015 09:00PM
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>.*)/. $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 Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

native variable for one level above $document_root ?

George March 07, 2015 04:26PM

Re: native variable for one level above $document_root ?

Francis Daly March 07, 2015 09:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 217
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready