V
V
vikholodov2018-05-24 12:37:15
Nginx
vikholodov, 2018-05-24 12:37:15

How to set up nginx for websocket on ubuntu?

Hi friends! Need help asap.
Deploying a django project commit with chat on websocket and asyncio on ubuntu 16.04.
On the front I get this error:

WebSocket connection to 'wss://host_ip:port/session_key/get_path' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

In general, as it usually happens (for me), everything works on LAN, and when you deploy, you start looking for the missing configs.
In nginx I tried to enter settings from this topic: https://ru.stackoverflow.com/questions/494996/%D0%... Absolutely
nothing has changed.
SSL is free with cloudflare, nginx listens on ports 80 and 443, keys are registered, https works
nginx config
erver {

    server_name project*;
    listen 80;
    listen 443;
    ssl_certificate         /home/dev/c.pem;
    ssl_certificate_key     /home/dev/k.key;
    location = /favicon.ico {
        alias project_path*/static/favicon.ico;
    }
#    location = /robots.txt {
#       project_path*/static/robots.txt;
#  }

    location /static/ {
        root project_path*/;
    }
    location /media/ {
        root project_path*/;
    }

    location / {
        include proxy_params;
        proxy_pass project_path*/project*.sock;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2018-05-24
@Wexter

Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

The host/port you are connecting to either does not support SSL or is not configured correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question