Nginx單獨配置conf文件


  在安裝目錄的 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;
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM