服务器上nginx无法访问html的配置问题
巴扎黑
巴扎黑 2017-06-20 10:07:52
0
1
930

服务器上 /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)
習慣沉默

端口写错了,已解决

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!