Correct nginx proxy Host header

The Host header should be the target host not the source host
This commit is contained in:
chriswue 2023-07-24 11:34:42 +12:00 committed by GitHub
parent a7ed46979f
commit d4457b6f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ server {
location /api { location /api {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $proxy_host;
proxy_pass ${NGINX_APISERVER_ADDR}; proxy_pass ${NGINX_APISERVER_ADDR};
rewrite /api/(.*) /$1 break; rewrite /api/(.*) /$1 break;
} }
@ -57,4 +57,4 @@ server {
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
location = /50x.html { location = /50x.html {
} }
} }