首页 > nginx如何设置访问xxx.com等同于xxx.com/html/web,并且域名不变呢?

nginx如何设置访问xxx.com等同于xxx.com/html/web,并且域名不变呢?

nginx如何设置访问xxx.com等同于xxx.com/html/web,并且域名不变呢?

访问xxx.com 其实是访问到的是xxx.com/html/web
而浏览器的url还是xxx.com
这样可以做到么
如何配置
谢谢指点~~


假如是一个静态或 cgi 方式的网站,用 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;
}
【热门文章】
【热门文章】