文章詳情頁
服務器上nginx無法訪問html的配置問題
瀏覽:165日期: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. python - scrapy url去重2. python執行cmd命令,怎么讓他執行類似Ctrl+C效果將其結束命令?3. node.js - 微信小程序websocket連接問題4. MySQL主鍵沖突時的更新操作和替換操作在功能上有什么差別(如圖)5. 實現bing搜索工具urlAPI提交6. Python中使用超長的List導致內存占用過大7. ios - 類似微博首頁,一張圖的時候是如何確定圖大小的?8. python - Django有哪些成功項目?9. 數據庫 - Mysql的存儲過程真的是個坑!求助下面的存儲過程哪里錯啦,實在是找不到哪里的問題了。10. 鏈接圖片時,鏈接不成功
排行榜
