subutai-io / agent

Subutai Agent is a tool that provides CLI to control Subutai infrastructure, and is a daemon that receives and performs Management commands through secured channels
https://subutai.io
15 stars 15 forks source link

Websocket proxy in port mappings #917

Open etursunbaev opened 5 years ago

etursunbaev commented 5 years ago

Need to add these nginx directives to templates

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";

to websocket proxying https://www.nginx.com/blog/websocket-nginx/ additional info can be found here

lbthomsen commented 5 years ago

And how will that influence non-websocket connections?

etursunbaev commented 5 years ago
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection $http_connection;

As discussed internally better add these lines to all templates and should not hurt anything

marcoarthur commented 4 years ago

Hello folks, I just hit this issue trying to understand why my deploy to subutai of Convos (http://convos.by/) that depends on WebSockets was failing to keep the connections up. But, these configurations didn't allow me to run it properly I had to add this line on the subutai-nginx configuration created by agent:

 proxy_http_version 1.1

After search for a while (https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version). As I read the docs referred, it states when http proxying the proxy is by default set to http 1.0. And that was the problem I was getting with this application. Thks all. :)

akarasulu commented 4 years ago

Good catch @marcoarthur. @etursunbaev was right. Perhaps the fix never made it out the door into production. Reopened to confirm fix.

dilshat commented 4 years ago

@marcoarthur hi I pushed your fix to DEV branch. You can test with dev peer

marcoarthur commented 4 years ago

Thanks @Dilshat ! Will setup a dev peer and give you feedback ASAP

marcoarthur commented 4 years ago

@Dilshat sorry couldn't really test it yet, without a sandbox env by the moment.

dilshat commented 4 years ago

@marcoarthur np , take your time !

dilshat commented 4 years ago

@marcoarthur hey buddy Did you have a chance to test the issue?