服務(wù)器上nginx無法訪問html的配置問題
問題描述
服務(wù)器上 /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只顯示了一個(gè)welcome to nginx的頁面,顯示不了我的index.html呢?
問題解答
回答1:端口寫錯(cuò)了,已解決
相關(guān)文章:
1. mysql優(yōu)化 - 關(guān)于mysql分區(qū)2. php laravel框架模型作用域3. node.js - 在vuejs-templates/webpack中dev-server.js里為什么要exports readyPromise?4. java - Atom中文問題5. java - MySQL中,使用聚合函數(shù)+for update會(huì)鎖表嗎?6. 請(qǐng)教各位大佬,瀏覽器點(diǎn) 提交實(shí)例為什么沒有反應(yīng)7. javascript - ionic2 input autofocus 電腦成功,iOS手機(jī)鍵盤不彈出8. html5 - 如何實(shí)現(xiàn)帶陰影的不規(guī)則容器?9. css3 - 這個(gè)形狀使用CSS怎么寫出來?10. javascript - 為什么這個(gè)點(diǎn)擊事件需要點(diǎn)擊兩次才有效果
