nginx中root與alias指令的區(qū)別
當(dāng)前位置:點(diǎn)晴教程→知識管理交流
→『 技術(shù)文檔交流 』
區(qū)別1. root 設(shè)置請求的根目錄,請求的路徑為:root 指定的根目錄拼接 location 匹配到的 uri 。 2. alias 請求的路徑為:alias 中指定的目錄替換 location 匹配規(guī)則 。 如以下配置中,請求 http://xxx.xxx.xxx.xxx/root_test/1.txt 會(huì)查找 /opt/web/hello/root_test/1.txt; 請求 http://xxx.xxx.xxx.xxx/alias_test/1.txt 會(huì)查找 /opt/web/hello/1.txt。
測試
該文章在 2025/7/1 22:40:28 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |