How do I configure nginx to proxy connections through a corporate proxy using HTTP when the proxied server uses HTTPS?
For example:
My corporate proxy: http://corporate-proxy.my-corporate.com:8080
Resource server: https://my-api.internal-address.my-corp.com
With curl I could do: curl -X GET -x "http://corporate-proxy.my-corporate.com:8080" "https://my-api.internal-address.my-corp.com"
With nginx I've tried:
upstream corporate_proxy {
server corporate-proxy.my-corporate.com:8080;
}
location /_internal/_resource
{
proxy_buffering off;
proxy_pass_header on;
proxy_set_header Host "my-api.internal-address.my-corp.com:443";
proxy_pass http://corporate_proxy;
}
But I get a 504 Gateway timeout as response.
My guess is that nginx is trying to use HTTP over the port 443 and therefore the server is not replying back or throwing some error.
How do I tell nginx to use HTTPS even though the corporate proxy is using HTTP?
For example:
My corporate proxy: http://corporate-proxy.my-corporate.com:8080
Resource server: https://my-api.internal-address.my-corp.com
With curl I could do: curl -X GET -x "http://corporate-proxy.my-corporate.com:8080" "https://my-api.internal-address.my-corp.com"
With nginx I've tried:
upstream corporate_proxy {
server corporate-proxy.my-corporate.com:8080;
}
location /_internal/_resource
{
proxy_buffering off;
proxy_pass_header on;
proxy_set_header Host "my-api.internal-address.my-corp.com:443";
proxy_pass http://corporate_proxy;
}
But I get a 504 Gateway timeout as response.
My guess is that nginx is trying to use HTTP over the port 443 and therefore the server is not replying back or throwing some error.
How do I tell nginx to use HTTPS even though the corporate proxy is using HTTP?