nginx root 和 alias 區別

location /test { 
            alias  /home/target/; 
            index  index.html; 
        }

這樣配置後,訪問:html

xxx.com/test/index.htmlnginx

實際訪問的服務器文件爲:服務器

/home/target/index.htmlcode

 

location /test { 
            root  /home/target/; 
            index  index.html; 
        }

這樣配置後,訪問:htm

xxx.com/test/index.htmlget

實際訪問的服務器文件爲:io

/home/target/test/index.htmlclass

相關文章
相關標籤/搜索