我正在使用docker compose来构建一个django,nginx作为服务的项目.当我启动daphne服务器,并且客户端尝试连接到websocket服务器时,我收到此错误:
*1 recv() failed (104: Connection reset by peer) while reading response header from upstream
Run Code Online (Sandbox Code Playgroud)
客户端显示了这一点
failed: Error during WebSocket handshake: Unexpected response code: 502
Run Code Online (Sandbox Code Playgroud)
这是我的docker-compose.yml
version: '3'
services:
nginx:
image: nginx
command: nginx -g 'daemon off;'
ports:
- "1010:80"
volumes:
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
- .:/makeup
links:
- web
web:
build: .
command: /usr/local/bin/circusd /makeup/config/circus/web.ini
environment:
DJANGO_SETTINGS_MODULE: MakeUp.settings
DEBUG_MODE: 1
volumes:
- .:/makeup
expose:
- '8000'
- '8001'
links:
- cache
extra_hosts:
"postgre": 100.73.138.65
Run Code Online (Sandbox Code Playgroud)
Nginx的:
server {
listen 80;
server_name …Run Code Online (Sandbox Code Playgroud)