Hi,
I have a Nginx as a reverse proxy for my Java application. The Nginx is configured with SSL to communicate with the outside and talk plain http with my Java application. This means that the redirects needs to be rewritten by Nginx in order to prevent the Location header to start with http://.
However, there is one redirect (that redirects users to an identity provider on Internet) where I do not wish to rewrite the Location header at all. And in some way, I can't make this work. The idp is an idp to use in dev-mode and thus the call is not encrypted.
I need some guidance in how to configure Nginx to support the scenario described above. My current configuration looks like:
server {
...
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_redirect http:// https://;
}
}
The url http://127.0.0.1:8080/oauth/authorize responds with a 302 Location https://external-idp.com but I want it to be http://external-idp.com. In my Java application the logs clearly says that "Redirecting to http://external-idp.com" so Nginx rewrites this header to https:// which is expected due to my configuration but what changes is needed to make the proxy_redirect not applicable on all paths?
/Marcus
I have a Nginx as a reverse proxy for my Java application. The Nginx is configured with SSL to communicate with the outside and talk plain http with my Java application. This means that the redirects needs to be rewritten by Nginx in order to prevent the Location header to start with http://.
However, there is one redirect (that redirects users to an identity provider on Internet) where I do not wish to rewrite the Location header at all. And in some way, I can't make this work. The idp is an idp to use in dev-mode and thus the call is not encrypted.
I need some guidance in how to configure Nginx to support the scenario described above. My current configuration looks like:
server {
...
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_redirect http:// https://;
}
}
The url http://127.0.0.1:8080/oauth/authorize responds with a 302 Location https://external-idp.com but I want it to be http://external-idp.com. In my Java application the logs clearly says that "Redirecting to http://external-idp.com" so Nginx rewrites this header to https:// which is expected due to my configuration but what changes is needed to make the proxy_redirect not applicable on all paths?
/Marcus