<div dir="ltr"><div>This must have been discussed before but I am new to nginx<br>and this forum. <br><br></div><div>I am upgrading to 1.4 to use its websocket proxy feature. <br></div><div>Say I have a websocket server running at port 81, so I want<br>
</div><div>to forward all websocket packets to port 81, and process<br></div><div>the rest at port 80. <br><br></div><div>Somehow the following conf doesn't work, anything missing?<br></div><div><br> server {<br> listen [::]:80 ipv6only=off; <br>
<br> location / {<br> regular_http_processing_directive;<br> <br> if ($http_upgrade = "websocket") {<br> proxy_pass <a href="http://localhost:81">http://localhost:81</a>; <br>
}<br><br> proxy_http_version 1.1;<br> proxy_set_header Upgrade websocket;<br> proxy_set_header Connection upgrade;<br> }<br> }<br></div><div><br></div>- Alder<br></div>