Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

variable which catch current directory of vhost config

$
0
0
Hi,
I would like to do something like this:

I have got my website at this directory
/home/www-data/my-domain.com

i have got my vhost config at
/home/www-data/my-domain.com/nginx.config

I have got at /etc/nginx/nginx.conf something like this
include /home/www-data/*/nginx.conf;

It would be great if i could use variable which catch directory name (which is vhost, server name, and root path) where my vhost nginx.config exist, then i shouldn't write config for every websites which is at /home/www-data/ direcotry, i could use the same nginx.config

Is it possible with nginx to catch this directory? Or any other way?

I would like to have in nginx something like __DIR__, and end(explode("/",__DIR__) in PHP for every included vhost config files

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>