Websockets on ALB not connecting (404 not found)

0

Edit: I accidentally submitted this twice. I'm marking this one as solved because I guess I can't delete posts.

I'm building a Django application on an ec2 that sits behind an application load balancer directing https traffic.
The ALB listens for https traffic and forwards it to the target group (http1, port 80) that contains the ec2 instance.

The Django app is running asgi through Daphne. Pretty simple configuration; host 0.0.0.0, port 80.
Https traffic works fine. No problems there. However I can't seem to get a simple websocket handshake.

in Firefox I get this error: GET wss://my_dns.com/ws/chat/lobby/ (HTTP/1.1 404 Not Found)
Firefox can’t establish a connection to the server at wss://my_dns.com/ws/chat/lobby

The security group for the ALB is allowing all inbound traffic on all ports.
I did have the target group originally set up without stickiness. I tried load balancing stickiness (1 day, 300 second deregistration delay, 0 slow start duration) and that didn't seem to work either.

All traffic, https and websockets is going through Daphne. I don't have any nginx reverse proxies or anything apache. It's just ALB and the ec2 instance and Daphne. I'm really hoping I have something incorrectly configured. haha.

Anyone have any thoughts where to begin troubleshooting this?

Thanks!

Edited by: BirdThunderford on Apr 14, 2021 7:54 PM

Edited by: BirdThunderford on Apr 14, 2021 7:58 PM

已提問 3 年前檢視次數 654 次
1 個回答
0

This is a duplicate question.

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南