Nginx 跨域访问

map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
}

upstream nodesocket {
        server 127.0.0.1:10080 fail_timeout=20s;
        server 127.0.0.1:10081 fail_timeout=20s;
    } 

    server {
        listen 80;
        server_name socket.localhost.com;
        location / {
            proxy_pass http://nodesocket;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        } 
    }

猜你喜欢

转载自zhaoyifei.iteye.com/blog/2293222
0条评论
添加一条新回复