Websocket + Django on production (https)

I am facing the same problem. my code almost identical to you, am using EC2, everything’s works accept WebSocket routing. it says Not Found: /ws/notification_approval/3/1/ .
Did you solved this? if yes then how? please share your solution.

I have tested without SSL and it works but when i use SSL WebSocket routing is not working.

If you’re looking for specific assistance with your issue, I suggest you open up a new topic for it. If you do, please be sure to include all the relevant configuration information along with the complete tracebacks from any error messages or relevant sections of log files.

1 Like

Hey @itsmahadi007,
Yes the option to run your django within AWS EB didn’t work for me with all the configuration mentioned above.
How did I solve the problem is just to build everything manually and host it in EC2. There you can configure all your servers manually. I think there is security layer or something that’s is blocking us to use wss when we used AWS EB.
Hope this helps you :slight_smile:

1 Like

hey @KenWhitesell
thanks for suggestions. Luckly My team were able to solve the problem by adding additional webocket support params on nginx

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;

These parameters allow the Nginx server to handle websocket connections properly by setting the appropriate headers and HTTP version. The proxy_http_version parameter sets the HTTP version to 1.1 for the proxy connection, which is necessary for upgrading the connection to a websocket connection. The proxy_set_header Upgrade parameter sets the Upgrade header in the HTTP request to the same value as the Upgrade header in the client request, while the proxy_set_header Connection parameter sets the Connection header in the HTTP request to “Upgrade”. These headers inform the server that the client wants to switch from HTTP to websockets.

1 Like