文章详情页
服务器上nginx无法访问html的配置问题
浏览:290日期: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. 为什么span的color非要内联样式才起作用?2. html5 - H5做的手机分享页微信更新后,分享出去不再默认显示第一个图 作为缩略图3. css - div设置float:left后高度设置自动会无效 ?4. golang - 用IDE看docker源码时的小问题5. docker start -a dockername 老是卡住,什么情况?6. 手机开发 - Android蓝牙模块连接后怎么接收数据?求助7. 小白问题getDay()8. 请问一下各位老鸟 我一直在学习独孤九贱 现在是在tp5 今天发现 这个系列视频没有实战9. 求救一下,用新版的phpstudy,数据库过段时间会消失是什么情况?10. 老师,请问我打开browsersync出现这个问题怎么解决啊?
排行榜

网公网安备