Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(docker:nginx): preserve public port in forwarded host headers

johavenc2bb1d71aa62
diff --git a/docker/config/nginx/eurooffice.conf b/docker/config/nginx/eurooffice.conf
index 30b412a0..5eacd5cb 100644
--- a/docker/config/nginx/eurooffice.conf
+++ b/docker/config/nginx/eurooffice.conf
@@ -2,11 +2,11 @@ location ^~ /onlyoffice/ {
proxy_pass http://eurooffice:80/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Host $host/onlyoffice;
+ proxy_set_header X-Forwarded-Host $http_host/onlyoffice;
proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $host;
+ proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_no_cache 1;
proxy_cache_bypass 1;
-}
\ No newline at end of file
+}
diff --git a/docker/config/nginx/nginx.conf b/docker/config/nginx/nginx.conf
index 13b3f432..1b2f0cdc 100644
--- a/docker/config/nginx/nginx.conf
+++ b/docker/config/nginx/nginx.conf
@@ -38,10 +38,10 @@ server {
# Buffering for requests proxied to Node
proxy_http_version 1.1;
chunked_transfer_encoding on;
- proxy_set_header Host $host;
+ proxy_set_header Host $http_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-Host $host;
+ proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
@@ -91,4 +91,4 @@ server {
# and you are not using an external URL.
# Uncomment the line below to enable it:
# include eurooffice.conf;
-}
\ No newline at end of file
+}
diff --git a/docker/config/nginx/onlyoffice.conf b/docker/config/nginx/onlyoffice.conf
index 17baea25..db1d447e 100644
--- a/docker/config/nginx/onlyoffice.conf
+++ b/docker/config/nginx/onlyoffice.conf
@@ -2,11 +2,11 @@ location ^~ /onlyoffice/ {
proxy_pass http://onlyoffice:80/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Host $host/onlyoffice;
+ proxy_set_header X-Forwarded-Host $http_host/onlyoffice;
proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $host;
+ proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_no_cache 1;
proxy_cache_bypass 1;
-}
\ No newline at end of file
+}