Is there a way to specify, for example, that the root
should be relative to the directory where the config file is living? Something like
root $conf_path/www
You can actually do that using the -p
option.
If you have your config file in the same directory as your app you can run:
/your/folder $ sudo nginx -c `pwd`/nginx.conf -p "`pwd`"
from your app folder.
Your nginx.conf
file changes from:
http {
include mime.types;
root /your/folder;
server {
listen 8000;
}
}
to
http {
include /etc/nginx/mime.types;
root .;
server {
listen 8000;
}
}
just make sure that you check relative links that pointed to /etc/nginx/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With