WebSocket http to https. This request has been blocked; this endpoint must be available over WSS.

In my computer my code well with ws://… but after deployment i got.

Mixed Content: The page at ' url ' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://url/ws/...'. This request has been blocked; this endpoint must be available over WSS.

I tried to do wss:// but

WebSocket connection to 'wss://url/ws/...' failed: 

I don’t have idea what is wrong here. My server nginx.

What does your nginx configuration look like for this?

server {
    listen 80;
    server_name chat.newuu.uz;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name chat.newuu.uz;

    ssl_certificate /etc/letsencrypt/live/chat.newuu.uz/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/chat.newuu.uz/privkey.pem;


    location /static {
        autoindex on;
        alias /home/user/portal_chat/static;
    }

    location / {
        proxy_pass http://127.0.0.1:5000;
    }
}

Hi.
Oo thank you for fast reply!

Is nginx serving the websocket only? Or is it serving a Django application in addition to the websockets?

You need different location directives for nginx to handle the websocket connections differently from your regular http traffic.

See:

Also see the threads at Connection failed in the websockets with channels and Websocket + Django on production (https) for examples.

1 Like

redis.exceptions.ResponseError: unknown command ‘BZPOPMIN’


when request comes to Daphne.

I have done every thing. Only one error is on redis please help!

Command:

 redis-cli INFO | grep version

If radis_version < 5: Update it. It is better to install through github.