文章详情页
服务器上nginx无法访问html的配置问题
问题描述
服务器上 /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. flexbox - css3[flex-shrink]属性在子项有 padding/box-sizing 属性时,是如何计算子项宽度的?2. 【python小白】 问关于property的顺序问题3. 9.png中在同一方向上设置多个拉伸位置,在android studio中怎么弄出来?4. angular.js - angular1如何使用跨域后的得到的数据5. angular.js - 如何在指令里使用ng-click6. android-studio - Android Studio 中有没有类似C#的#if DEBUG功能7. angular.js input输入正确数据框变红色8. JS怎么给每相隔一行的TD添加filter滤镜?9. angular.js - Angular 像这种重复判断的表达式 有什么好的解决办法吗?~10. android-studio - android studio自带模拟器中的本地“图库”所对应的路径是什么?
排行榜