node項目配置成nginx啟動


node項目配置成nginx啟動

1、新建ant.conf

upstream antNodeJs{
    server 127.0.0.1:8000;
    keepalive 64;
}

server
    {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;
        server_name jiqing.ant.com;
        
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host  $http_host;
            proxy_set_header X-Nginx-Proxy true;
            proxy_set_header Connection "";
            proxy_pass      http://antNodeJs;

        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/access.log;
}

2、修改hosts

127.0.0.1   jiqing.ant.com

3、重啟nginx

sudo lnmp restart


免責聲明!

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



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