From b8a3b6106bbc026dfdb337360d0842ec4a3d645c Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 23 Jan 2021 14:10:30 -0600 Subject: [PATCH] =?UTF-8?q?feat(reverse-proxy):=20=E2=9C=A8=20pass=20X-Rea?= =?UTF-8?q?l-IP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reverse-proxy/conf.d.dev/default.conf | 15 +++++++++------ reverse-proxy/conf.d/default.conf | 20 ++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/reverse-proxy/conf.d.dev/default.conf b/reverse-proxy/conf.d.dev/default.conf index 0d4523200..f7eea1d61 100644 --- a/reverse-proxy/conf.d.dev/default.conf +++ b/reverse-proxy/conf.d.dev/default.conf @@ -5,10 +5,11 @@ server { rewrite ^/api/archival/(.*)$ /$1 break; proxy_pass http://archival-api:80; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } @@ -17,10 +18,11 @@ server { rewrite ^/api/directory/(.*)$ /$1 break; proxy_pass http://directory-api:80; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } @@ -29,10 +31,11 @@ server { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://api-docs:8080; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } diff --git a/reverse-proxy/conf.d/default.conf b/reverse-proxy/conf.d/default.conf index 88a2c4216..32fc4b017 100644 --- a/reverse-proxy/conf.d/default.conf +++ b/reverse-proxy/conf.d/default.conf @@ -13,10 +13,11 @@ server { rewrite ^/api/archival/(.*)$ /$1 break; proxy_pass http://archival-api:80; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } @@ -25,10 +26,11 @@ server { rewrite ^/api/directory/(.*)$ /$1 break; proxy_pass http://directory-api:80; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } @@ -37,10 +39,11 @@ server { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://api-docs:8080; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; } @@ -48,10 +51,11 @@ server { location / { proxy_pass http://web:80; proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; + 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-Proto $scheme; }