首页 > 其他 > 详细

Nginx单独配置conf文件

时间:2020-05-16 16:58:10      阅读:120      评论:0      收藏:0      [点我收藏+]

  在安装目录的 nginx.conf的最后一行加上:include /www/server/nginx/conf.d/*.conf;

  技术分享图片

  技术分享图片

   另,如果不想单独配置的话,可以在nginx.conf里添加多个server,同级添加即可,注意不要加错地方。

  

  顺便记一下nginx简化配置:

  

server { listen 80;
    server_name   域名(填自己的);
    location / {
        proxy_pass         http://localhost:5000(本机ip+端口);
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}

 

Nginx单独配置conf文件

原文:https://www.cnblogs.com/sunshine-wy/p/12901011.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!