文章詳情頁(yè)
url-rewrite - nginx如何設(shè)置訪問(wèn)xxx.com等同于xxx.com/html/web,并且域名不變呢?
瀏覽:117日期:2023-08-17 08:06:26
問(wèn)題描述
nginx如何設(shè)置訪問(wèn)xxx.com等同于xxx.com/html/web,并且域名不變呢?
訪問(wèn)xxx.com 其實(shí)是訪問(wèn)到的是xxx.com/html/web而瀏覽器的url還是xxx.com這樣可以做到么如何配置謝謝指點(diǎn)~~
問(wèn)題解答
回答1:假如是一個(gè)靜態(tài)或 cgi 方式的網(wǎng)站,用 try_files 可能會(huì)比較好。
root /path/to/root;index index.html index.html index.php;location / { try_files /html/web/$uri /html/web/$uri/ $uri $uri/ =404;}
標(biāo)簽:
HTML
排行榜

熱門標(biāo)簽