url-rewrite - nginx如何设置访问xxx.com等同于xxx.com/html/web,并且域名不变呢?
PHPz
PHPz 2017-05-16 17:24:26
0
1
638

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

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

PHPz
PHPz

学习是最好的投资!

全部回复(1)
为情所困

假如是一个静态或 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;
}
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板