url-rewrite - How to set nginx to access xxx.com equal to xxx.com/html/web, and keep the domain name unchanged?
PHPz
PHPz 2017-05-16 17:24:26
0
1
637

How to set nginx to access xxx.com equal to xxx.com/html/web, and keep the domain name unchanged?

When you visit xxx.com, you actually visit xxx.com/html/web
The url of the browser is still xxx.com
Is this possible?
How to configure
Thanks for the advice~~

PHPz
PHPz

学习是最好的投资!

reply all(1)
为情所困

If it is a static or cgi website, it may be better to use try_files.

root /path/to/root;
index index.html index.html index.php;

location / {
    try_files /html/web/$uri /html/web/$uri/ $uri $uri/ =404;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template