Same certificate on many ports, is it possible?

Hi.

I have a static website with SSL on Nginx on port 443.
Very standard configuration, everything working.

Then I created an api on Node and set a proxy at Nginx from port 9569 (external) to port 9570 (internal).
And again, everything working, pretty normal config.

And then I copy this lines from site Nginx file config:

ssl_certificate         /etc/letsencrypt/live/mysecretsite.com/fullchain.pem;
ssl_certificate_key     /etc/letsencrypt/live/mysecretsite.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mysecretsite.com/chain.pem;

And paste it on my proxy:

listen                  9569;
server_name mysecretsite.com;

ssl_certificate         /etc/letsencrypt/live/mysecretsite.com/fullchain.pem;
ssl_certificate_key     /etc/letsencrypt/live/mysecretsite.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mysecretsite.com/chain.pem;

location / {
		proxy_pass http://127.0.0.1:9570;
}

And then I got this error: SSL_ERROR_RX_RECORD_TOO_LONG.

What should I do?

2 Likes
listen                  9569 ssl;
5 Likes

That's it.

Thank you _az.

3 Likes