I am trying to setup a nginx server that forwards the incoming request to a corporate porxy (its a mcafee proxy) with a proxy header Host and the actual destination host something like proxy_set_header Host xyz.com:443
.
This works perfectly fine for http requests but not for https
here is my nginx.conf (assuming no proxy auth required)
server {
listen 80;
location /test/ {
proxy_pass http://my-corporate-proxy:8080/;
proxy_set_header Host mytargetdomain.com:443;
}
here my expectation is when i hit http://localhost:80/test/api/health
the request should go to nginx and then to http://my-corporate-proxy:8080/api/health
with Host header and from my proxy it should initiate a https request like https://mytargetdomain.com/api/health
.
but this doesnt happening in case of https.
is there any way I can make it work ? or if I make nginx honour system proxy that should also fine.
Thanks in advance.
0 Answers