文章详情页
服务器上nginx无法访问html的配置问题
浏览:176日期: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 - 在静态页面上用load 引入的页面文件问题?2. 代理 - 一个nginx需求,访问web服务时,若用户为测试用户则转发到web服务的测试版本3. javascript - webpack打包后的bundlejs文件代码不知道什么意思.4. java后台导出页面到pdf5. java - instance method中 static后的<K>是什么意思?6. css3 - css如何实现素描描边效果7. css - 关于ul的布局8. css - 如何使用 vue transition 实现 ios 按钮一样的平滑切换效果9. javascript - vue组件通过eventBus通信时,报错a.$on is not a function10. html - 哪些情况下float会失效?
排行榜
