Proxying websocket (to e.g. tomcat)

Nikolai Zhubr n-a-zhubr at yandex.ru
Thu Feb 21 15:55:45 UTC 2013


21.02.2013 18:30, Valentin V. Bartenev wrote:
[...]
>
> Yes, it's possible with 1.3.13. And yes, you need some additional configuration.
>
> Example:
>
>      location /examples/websocket {
>          proxy_pass  http://127.0.0.1:8080;
>          proxy_http_version 1.1;
>          proxy_set_header Upgrade $http_upgrade;
>          proxy_set_header Connection "upgrade";
>      }
Ah, this indeed helped! Now it works. Thank you very much.

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?)

Thank you.
Nikolai

>
> Docs:
>
>    http://nginx.org/r/proxy_http_version
>    http://nginx.org/r/proxy_set_header
>
>
>   wbr, Valentin V. Bartenev
>
> --
> http://nginx.com/support.html
> http://nginx.org/en/donation.html
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>



More information about the nginx mailing list