I have a some case to map in nginx
- for / it take from the /var/www/html/cont
- for /content/* it take form the var/www/html/cont
- if it is not / and not /content/*
the it should take from /var/www/html/web
i am stucking in case 3
Here is my config
location / {
root /var/www/html/cont;
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
# try_files $uri $uri/ =404;
}
location /content {
root /var/www/html/cont;
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
# try_files $uri $uri/ =404;
}
Any help appreciated.
Thank you
2
Answers
Here is my solution which works perfectly in as per my use case.
Set
root
forserver {}
context asroot /var/www/html/web;
then