文章詳情頁
服務器上nginx無法訪問html的配置問題
瀏覽:180日期: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. java - spring-data Jpa 不需要執行save 語句,Set字段就可以自動執行保存的方法?求解2. html5 - 微信瀏覽器視頻播放失敗3. javascript - 這問題怎么處理額4. css3 - 為什么css里面要帶-moz-|-webkit-后又來一個不帶它們的5. 網頁爬蟲 - Python 爬蟲中如何處理驗證碼?6. javascript - jQuery中live事件在移動微信端下沒有效果;代碼如下7. javascript - SuperSlide.js火狐不兼容怎么回事呢8. javascript - owl.carousel.js這個插件的原作者的網址是多少了?9. phpstady在win10上運行10. 在應用配置文件 app.php 中找不到’route_check_cache’配置項
排行榜
