Skip to content

Commit

Permalink
feat: Replace $http_host in nginx.conf, add support for proxies
Browse files Browse the repository at this point in the history
When using a reverse proxy in front of the application,
`$http_host` might point to an network internal address.
The `proxy_redirect` response points to the internal address then,
which leads to redirects to internal addresses (failing requests).
  • Loading branch information
MoritzWeber0 committed Oct 2, 2023
1 parent 34bcaaa commit b1c1941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helm/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ http {
location /api/v1/ {
client_max_body_size 30m;
proxy_pass http://{{ .Release.Name }}-backend:80;
proxy_redirect http://{{ .Release.Name }}-backend {{ .Values.general.scheme }}://$http_host;
proxy_redirect http://{{ .Release.Name }}-backend:80 {{ .Values.general.scheme }}://$http_host;
proxy_redirect http://{{ .Release.Name }}-backend {{ .Values.general.scheme }}://{{ .Values.general.host }}:{{ .Values.general.port }};
+ proxy_redirect http://{{ .Release.Name }}-backend:80 {{ .Values.general.scheme }}://{{ .Values.general.host }}:{{ .Values.general.port }};
}
}
}

0 comments on commit b1c1941

Please sign in to comment.