<div dir="ltr">It seems I sent to wrong mailing list... got no response. So forwarding this question at "<span style="font-size:12.8px"><a href="mailto:nginx@nginx.org">nginx@nginx.org</a>"</span><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">vikrant singh</b> <span dir="ltr"><<a href="mailto:vikrant.thakur@gmail.com">vikrant.thakur@gmail.com</a>></span><br>Date: Tue, Sep 22, 2015 at 12:38 PM<br>Subject: Config Guidance<br>To: <a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a><br><br><br><div dir="ltr">Hello,<div>I have quick question on config. On my reverse proxy I need to serve both web-socket and normal http request.</div><div><br></div><div>For websocket request I add following in request...</div><div><br></div><div><font face="comic sans ms, sans-serif">proxy_set_header Upgrade $http_upgrade;<br></font></div><div><font face="comic sans ms, sans-serif">proxy_set_header Connection "upgrade";<br></font></div><div><font face="comic sans ms, sans-serif">proxy_http_version 1.1;<br></font></div><div><font face="comic sans ms, sans-serif">proxy_pass $servAdd;<br></font></div><div><br></div><div>And for normal ones I just do </div><div><font face="comic sans ms, sans-serif">proxy_pass $servAdd;</font><br></div><div><br></div><div>My question is how to unify these two in a single location directive? I can identify a websocket request and add extra header in a if block. But as using if is not recommended I am not sure if I should do that.</div><div><br></div><div>Any advise?</div><div>Thanks,</div><div>Vikrant</div><div><br></div></div>
</div><br></div>