Proxy HTTPS requests to a HTTP backend with NGINX.
Posted
by Mike
on Server Fault
See other posts from Server Fault
or by Mike
Published on 2010-05-26T09:28:02Z
Indexed on
2010/05/26
9:33 UTC
Read the original article
Hit count: 243
I have nginx configured to be my externally visible webserver which talks to a backend over HTTP.
The scenario I want to achieve is:
- Client makes HTTPS request to nginx
- nginx proxies request over HTTP to the backend
- nginx receives response from backend over HTTP.
- nginx passes this back to the client over HTTPS
My current config (where backend is configured correctly) is:
server { listen 80; server_name localhost; location ~ .* { proxy_pass http://backend; proxy_redirect http://backend https://$host; proxy_set_header Host $host; } }
My problem is the response to the client (step 4) is sent over HTTP not HTTPS. Any ideas?
© Server Fault or respective owner