nginx代理websocket配置

42 阅读1分钟

nginx配置

		location /websocket {
			proxy_http_version 1.1;           
                        proxy_set_header Upgrade $http_upgrade;
                        proxy_set_header Connection "upgrade";
			proxy_pass http://127.0.0.1:10000/websocket;
		}

前端地址配置

wss://abc.com/websocket/    # https
ws://abc.com/websocket/     # http