Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: location match help

$
0
0
Hello Yumi

Thanks for the update. My current set up is
root /var/www

location = / {
root /var/www/home

}



M requrirement is
site.com /var/www/home
site.com/blog /var/www/blog
site.com/user /var/www/user
site.com/anything /var/www/anything

That is when I try site.com it should load from /var/www/home everything else should read from /var/www

It works with following configuration

root /var/www;
location = / {
rewrite ^ /home break;
}

But issue is site.com will redirect to site.com/home

This redirection can avoid by adding a '/' after home

root /var/www
location = / {
rewrite ^ /home/ break;
}

With above setup when I try site.com it will load index.html from /var/www/home as needed. But it is not reading css,js folders from same location it is trying load those folders from /var/www

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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