Centrifugo Django. отключение после обработки команды reason="bad request"
Я пытаюсь следовать этому учебнику:
Но после выполнения всех шагов я не вижу никаких сообщений и имею следующее в журналах центрифуги:
2024-06-12 20:42:18 [INF] disconnect after handling command client=5bf22df5-8051-463b-9c41-4a6e9d92865a command=id:6 reason="bad request" user=
Похоже, что это происходит при выполнении centrifuge.connect() (в файле chat.templates.chat.rooms.html).
Вот журналы из контейнера NGINX:
192.168.65.1 - - [12/Jun/2024:17:44:26 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.65.1 - - [12/Jun/2024:17:44:30 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.65.1 - - [12/Jun/2024:17:44:42 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.65.1 - - [12/Jun/2024:17:44:44 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.65.1 - - [12/Jun/2024:17:44:58 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.65.1 - - [12/Jun/2024:17:45:01 +0000] "GET /connection/websocket HTTP/1.1" 101 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
Вот мой config.json для centrifugo:
{
"port": 8001,
"engine": "redis",
"redis_address": "redis://localhost:6379",
"allowed_origins": [
"http://localhost:9000",
"http://127.0.0.1:9000"
],
"proxy_connect_endpoint": "http://localhost:8000/chat/centrifugo/connect/",
"proxy_publish_endpoint": "http://localhost:8000/chat/centrifugo/publish/",
"proxy_subscribe_endpoint": "http://localhost:8000/chat/centrifugo/subscribe/",
"proxy_http_headers": ["Cookie"],
"namespaces": [
{
"name": "rooms",
"publish": true,
"proxy_publish": true,
"proxy_subscribe": true
}
]
}
Вот мой nginx.conf:
events {
worker_connections 1024;
}
error_log /dev/stdout info;
http {
access_log /dev/stdout;
server {
listen 9000;
server_name localhost;
location / {
proxy_pass http://host.docker.internal:8000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /connection/websocket {
proxy_pass http://host.docker.internal:8001;
proxy_http_version 1.1;
proxy_buffering off;
keepalive_timeout 65;
proxy_read_timeout 60s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
}
Не могли бы вы подсказать мне, как отладить и решить эту проблему?