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

Re: location match help

$
0
0
I presume you're refering to all _files_ should be served from the /home directory if the user visits / ?

For example:
http://example.com/file.html -> /var/www/home/file.html
http://example.com/ -> /var/www/home/
http://example.com/home/file.html -> /var/www/home/file.html
http://example.com/css/style.css -> /var/www/css/style.css
http://example.com/css/ -> /var/www/css/
http://example.com/a/b/c.html -> /var/www/a/b/c.html

If this is the case, perhaps this could work:

root /var/www;
rewrite ^/([^/]*)$ /home/$1 break;

(untested)

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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