I'm doing a proxy_pass
in nginx on port 80 to 8000 on my remote server, and then a port forward from 8000 to 80 from the remote to my localhost. This works great, but I'd also like to do it with https but it seems like nginx needs a valid cert to pass the traffic on.
Is there a way for my remote server to simply forward the trafic from port 443 to say 8443 (and then I'll forward remote 8443 to local 443). Then terminate ssl on my development machine instead instead of needing to do it on the remote server?
Best Answer
While nginx probably has a third-party module to deal with raw TCP connections, I'm pretty sure that by default everything has to be either HTTP or terminated HTTPS. I think in your situation I'd do port forwarding at the network level:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443