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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则