Add WebSocket upgrade headers to nginx API proxy blocks for docs collaboration
The /api/ location blocks in both default.conf and services.conf templates were missing Upgrade/Connection headers, preventing the Hocuspocus WebSocket connection from establishing through nginx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b136396f3b
commit
33e1ff2907
@ -79,8 +79,8 @@ server {
|
||||
# Rewrites /media/* to /api/* (matches Vite dev proxy behavior)
|
||||
# Uses variable proxy_pass for runtime DNS resolution after container restarts
|
||||
location /media/ {
|
||||
rewrite ^/media/(.*) /api/$1 break;
|
||||
set $upstream_media_default http://changemaker-media-api:4100;
|
||||
rewrite ^/media/(.*) /api/$1 break;
|
||||
proxy_pass $upstream_media_default;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@ -126,5 +126,9 @@ server {
|
||||
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;
|
||||
|
||||
# WebSocket support (docs collaboration)
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
|
||||
@ -444,8 +444,8 @@ server {
|
||||
# Rewrites /media/* to /api/* (matches Vite dev proxy behavior)
|
||||
# Uses variable proxy_pass for runtime DNS resolution after container restarts
|
||||
location /media/ {
|
||||
rewrite ^/media/(.*) /api/$1 break;
|
||||
set $upstream_media_app http://changemaker-media-api:4100;
|
||||
rewrite ^/media/(.*) /api/$1 break;
|
||||
proxy_pass $upstream_media_app;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@ -502,6 +502,10 @@ server {
|
||||
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;
|
||||
|
||||
# WebSocket support (docs collaboration)
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user