我想從檔案夾 /var/www/fileUpload/html 中呼叫 index.html。index.html 檔案存在于該檔案夾中。
/ 路由器作業。uploadFiles 路由也是如此。但是當我打開上傳路線時,我收到了 404 錯誤。
server{
listen 80;
server_name xx.xx.xxx.xxx;
location / {
root /var/www/kioskJPE/html;
index index.html;
}
location /upload {
root /var/www/fileUpload/html;
index index.html;
}
location /uploadFiles {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
你有什么建議嗎?謝謝!
uj5u.com熱心網友回復:
那應該是alias /var/www/fileUpload/html;否則 Nginx 正在尋找/var/www/fileUpload/html/upload/index.html. 有關詳細資訊,請參閱此檔案。
例如:
location /upload {
alias /var/www/fileUpload/html;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/409322.html
標籤:
