文章详情页
服务器上nginx无法访问html的配置问题
浏览:158日期: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. docker gitlab 如何git clone?2. java报错Communications link failure 该如何解决?3. android - 项目时间长了,字符串文件strings有的字符串可能是多余的,有没有办法快速检测那些是没用的?4. javascript - 怎么看网站用了什么技术框架?5. mysql - 用PHPEXCEL将excel文件导入数据库数据5000+条,本地数据库正常,线上只导入15条,没有报错,哪里的问题?6. angular.js使用$resource服务把数据存入mongodb的问题。7. 刷新页面出现弹框8. 关于Android权限的获取问题,大家遇到过这样的情况嘛?9. angular.js - angularJs ngRoute怎么在路由传递空字符串及用ng-switch取得10. PC 手机兼容的 编辑器
排行榜
