文章詳情頁
url-rewrite - nginx如何設置訪問xxx.com等同于xxx.com/html/web,并且域名不變呢?
瀏覽:85日期:2023-08-17 08:06:26
問題描述
nginx如何設置訪問xxx.com等同于xxx.com/html/web,并且域名不變呢?
訪問xxx.com 其實是訪問到的是xxx.com/html/web而瀏覽器的url還是xxx.com這樣可以做到么如何配置謝謝指點~~
問題解答
回答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;}
標簽:
HTML
排行榜
