Skip to content

Commit

Permalink
Merge pull request #6115 from BacLuc/fix-reverse-proxy
Browse files Browse the repository at this point in the history
reverse-proxy-nginx.conf: reverse proxy upgrade response for websockets
  • Loading branch information
manuelmeister authored Oct 15, 2024
2 parents 8b4b9aa + c1372c9 commit 5f82d7d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions reverse-proxy-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

resolver 127.0.0.11;
include /etc/nginx/mime.types;
default_type application/octet-stream;
Expand All @@ -21,6 +26,8 @@ http {

location / {
proxy_pass http://frontend:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /api/ {
Expand All @@ -31,14 +38,20 @@ http {
proxy_busy_buffers_size 256k;
proxy_set_header X-Forwarded-Prefix /api;
proxy_pass http://api:3001/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /print {
proxy_pass http://print:3003;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /mail {
proxy_pass http://mail:1080;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
server {
Expand All @@ -47,6 +60,8 @@ http {

location / {
proxy_pass http://frontend:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /api/ {
Expand All @@ -57,14 +72,20 @@ http {
proxy_busy_buffers_size 256k;
proxy_set_header X-Forwarded-Prefix /api;
proxy_pass http://http-cache:8080/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /print {
proxy_pass http://print:3003;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /mail {
proxy_pass http://mail:1080;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}

0 comments on commit 5f82d7d

Please sign in to comment.