Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

handle proxy redirects even if the scheme doesn't match #61

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

hone
Copy link
Member

@hone hone commented Mar 15, 2017

Normally, when receiving a Location header, nginx will rewrite it to reference a URL if it matches the proxy_pass. This breaks when the scheme changes, since proxy_pass can have a scheme. For instance, if you have a proxy: "https://www.foo.com", but the Location on a redirect from that site returns "http://www.foo.com" nginx won't rewrite the URL. This fixes it by specifying the redirect for both http and https.

Normally, when receiving a Location header, nginx will rewrite it to
reference a URL if it matches the proxy_pass. This breaks when the
scheme changes, since proxy_pass can have a scheme. For instance, if you
have a proxy: "https://www.foo.com", but the Location on a redirect from
that site returns "http://www.foo.com" nginx won't rewrite the URL. This
fixes it by specifying the redirect for both http and https.
@hone hone merged commit fb0a495 into master Mar 15, 2017
@hone hone deleted the proxy_redirect branch March 15, 2017 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant