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

node项目配置成nginx启动_第1张图片

node项目配置成nginx启动_第2张图片

转载于:https://www.cnblogs.com/jiqing9006/p/10504662.html

你可能感兴趣的:(node项目配置成nginx启动)