Skip to content

Commit

Permalink
Fix nginx config for ws error
Browse files Browse the repository at this point in the history
  • Loading branch information
usatie committed Nov 1, 2023
1 parent c5396be commit 20898c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ services:
web:
volumes:
- ./web/html:/var/www/playground
- ./web/nginx.conf:/etc/nginx/nginx.conf
frontend:
volumes:
- ./frontend:/app
Expand Down
16 changes: 16 additions & 0 deletions web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@ http {
}
location / {
proxy_pass http://frontend:3000;
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_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api {
proxy_pass http://backend:3000;
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_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
}

0 comments on commit 20898c2

Please sign in to comment.