Welcome! Log In Create A New Profile

Advanced

Re: Proxying websocket (to e.g. tomcat)

Nikolai Zhubr
February 21, 2013 04:54PM
21.02.2013 20:03, Valentin V. Bartenev wrote:
[...]
>> Apparently such configuration implies that different kinds of
>> connections (standard and websocket) can not be mixed in one "location"
>> section? (As far as I understood it, magic headers do not get through
>> directly, but essentially get reintroduced by these configuration
>> settings?)
>>
>
> Not quite so. Actually, they can be mixed. That's why the $http_upgrade variable
> used. If there's no such header in request, then the variable is empty and the
> header won't be set.

You are right. Now I see. I've even actually made some tests to be
completely sure and they all worked correctly.

Thank you for precise explanation and usefull examples!

Nikolai

>
> You can also set the Connection header to different values depending on
> existence of the Upagrade header in a request.
>
> Example:
>
> http {
> map $http_upgrade $conn_header {
> default upgrade;
> '' close;
> }
>
> server {
> ...
>
> location {
> proxy_pass http://127.0.0.1:8080;
> proxy_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection $conn_header;
> }
> }
>
> http://nginx.org/r/map
>
>
> wbr, Valentin V. Bartenev
>
> --
> http://nginx.com/support.html
> http://nginx.org/en/donation.html
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxying websocket (to e.g. tomcat)

Nikolai Zhubr February 21, 2013 09:16AM

Re: Proxying websocket (to e.g. tomcat)

Valentin V. Bartenev February 21, 2013 09:32AM

Re: Proxying websocket (to e.g. tomcat)

Nikolai Zhubr February 21, 2013 10:38AM

Re: Proxying websocket (to e.g. tomcat)

Valentin V. Bartenev February 21, 2013 11:06AM

Re: Proxying websocket (to e.g. tomcat)

Nikolai Zhubr February 21, 2013 04:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready