nginx $document_uri 参数使用
生活随笔
收集整理的這篇文章主要介紹了
nginx $document_uri 参数使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
$document_uri??表示訪問的url?
現在我的需求是,訪問 www.abc.com??請求到 www.abc.com/abc/
在nginx配置文件中加入
if ($document_uri !~ 'abc')
{
rewrite ^/(.*)$ http://www.abc.com/abc/$1 permanent;
}
而不是單獨加一句??rewrite ^/(.*)$ http://www.abc.com/abc/$1 permanent;
如果只加rewrite 規則,而不限定條件,那么會造成死循環。??會訪問到? ?http://www.abc.com/abc/abc/abc/abc/....
轉載于:https://www.cnblogs.com/the-study-of-linux/p/4983288.html
總結
以上是生活随笔為你收集整理的nginx $document_uri 参数使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: response.setStatus的时
- 下一篇: 理解restful