匹配除study以外的路徑 比如http://127.0.0.1/index.html
用途:加載靜態網頁 訪問http://127.0.0.1/index.html 就可以加載 D:\dev\shop\index.html
location / {
root D:\dev\shop;
index remember.html;
}
匹配 study開頭的url 比如 http://127.0.0.1/study/users
用途: 可以轉發到後臺服務
location /study {
proxy_pass http://127.0.0.1:8088;
proxy_redirect off;
proxy_connect_timeout 2s;
client_max_body_size 100m;
}
nginx 做轉發
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.