Search code examples
sslnginxhttpsiptablesnginx-config

How to disable ssl certificate and only used to forward traffic on port 443 in Nginx?


Host A has https service serviceA and provides two IP for high availability。

e.g. Bose [ip1:443] and [ip2:443] are routed to the serviceA.

Host B (do not has ssl_certificate and ssl_certificate_key) use Nginx proxy module to proxies the requests towards the actual serviceA. How to simply forward 443 port traffic to serviceA without ssl verification? Here is my config:

http {
  upstream backend {
    server [ip1]:443;
    server [ip2]:443;
  }

  server {
    listen       443;
    listen       [::]:443;

    location / {
        proxy_pass  https://backend;
    }

  }
}

Solution

  • There're two theoretically possible ways to solve your issue:

    1. Nginx with ngx_stream_ssl_preread module

    2. HAproxy (for balancing) -> proxy_protocol -> Nginx (with ssl certs)