我正在運行nginx v 1.0.4,我們正在嘗試執行以下操作:
location ~ ^/${
rewrite ^.*$ /index.html last;
}
基本上:如果用戶到達默認域http://www.foo.com或http://www.foo.com/將其重定向到http://www.foo.com/index.html
當我將其添加到我的conf檔案中時,我得到以下內容:在/etc/nginx/myconf.conf中啟動nginx:nginx:[emerg] unknown指令“”
提前致謝.
uj5u.com熱心網友回復:
您可以在沒有位置的情況下使用重寫功能rewrite ^/$ /index.html last;
或永久重定向
rewrite ^/$ /index.html permanent;
用引數重寫,例如http://www.foo.com/?param=value – > http://www.foo.com/index.html?param=value
rewrite ^/(\?.*)?$ /index.html$1 permanent;
uj5u.com熱心網友回復:
location / {root /home/OBE;
index 登錄界面.html;
}
如此配置 直接訪問ip為什么不自動跳轉到 登錄界面.html
而是報錯 403
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/126184.html
標籤:其他技術討論專區
下一篇:win 10系統引導uefi修復
