用于配置域名访问,可以用于nodejs或go服务器的反代

server {
    listen       80;
    server_name  www.niyaoxuehao.cn;
    location / {
        proxy_pass http://localhost:3000;  //具体代理的端口号
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    error_page  500 502 503 504  /50x.html;
    location = /50x.html {
        root  /usr/share/nginx/html;
    }
}

标签: none

评论已关闭