文章詳情頁
服務器上nginx無法訪問html的配置問題
瀏覽:168日期:2023-08-14 09:45:10
問題描述
服務器上 /www/cms/production/current/dist 下有index.html
nginx配置:
server { listen 3002; root /www/cms/production/current/dist; index index.html; server_name xxx.xxx.com; location / { try_files $uri $uri/ /index.html; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_pass http://127.0.0.1:3000/api; proxy_redirect off; }}
為何通過xxx.xxx.com只顯示了一個welcome to nginx的頁面,顯示不了我的index.html呢?
問題解答
回答1:端口寫錯了,已解決
標簽:
HTML
上一條:vue.js - weex 沒有背景圖片屬性怎么辦?下一條:javascript - mongodb線上環境報錯Db.prototype.authenticate method will...
相關文章:
1. javascript - 關于apply()與call()的問題2. javascript - axios請求回來的數據組件無法進行綁定渲染3. java - 在用戶不登錄的情況下,用戶如何添加保存到購物車?4. javascript - JS變量被清空5. javascript - 有適合開發手機端Html5網頁小游戲的前端框架嗎?6. Python中使用超長的List導致內存占用過大7. css3 - 純css實現點擊特效8. 安全性測試 - nodejs中如何防mySQL注入9. javascript - jQuery post()方法,里面的請求串可以轉換為GBK編碼么?可以的話怎樣轉換?10. html5 - 請問現在主流的前端自動化構建工具是哪個?
排行榜
