nginx指定文件路徑有兩種方式root和alias,root與alias主要區(qū)別在于nginx如何解釋location后面的uri,這會(huì)使兩者分別以不同的方式將請求映射到服務(wù)器文件上。 最基本的區(qū)別 alias 指定的目錄是準(zhǔn)確的,給location指定一個(gè)目錄。root 指定目錄的上級目錄,并且該上級目錄要含有l(wèi)ocatoin指定名稱的同名目錄。
Nginx Location基本語法 location syntax: location [=|~|~*|^~] /uri/ { … } 語法:location [=|~|~*|^~] /uri/ { … } default: no 默認(rèn):否 context: server 上下文:server This directive allows different configurations depending on the URI. It can be configured using both conventional string...