Nginx – HTTPS to HTTPS reverse proxy with nginx

apache-2.2httpsnginxPROXYssl

I have an Apache webserver configures with an SSL certificate. I have to put it behind a proxy, from some reasons.
I'd like to configure the proxy (nginx?) to works as simple relay, from HTTPS to HTTPS, as simple as possible.

My questions are:

  • is HTTPS to HTTPS proxy a good idea?
  • if so, do I need to give the proxy the SSL certificate too or can I just enable SSL in nginx/apache/whatever's parameters?

Thanks a lot for your help 🙂

Best Answer

is HTTPS to HTTPS proxy a good idea?

Depends on the situation/use-case/reasoning, there's no one-fits-all answer for that.

if so, do I need to give the proxy the SSL certificate too or can I just enable SSL in nginx/apache/whatever's parameters?

Yes and No!

You have two ways of doing this:

  1. SSL Reverse Proxy
  2. TCP Load Balancing

SSL Reverse Proxy

Certificates are needed on the load balancer, you set up a HTTPS proxy and all HTTPS connections to the load balancer are terminated there before being proxied to the backends and the HTTPS re-applied if your backend supports it.

TCP Load Balancing

You do not need SSL certificates on the load balancer. The connections are distributed at the TCP layer, the SSL content is ignored/unmodified and just passed through. Your backend needs to be HTTPS ready with the SSL certs etc.

Hopefully this will set you in the right direction...