The original post: /r/nginx by /u/Satrapes1 on 2024-12-25 22:01:38.

Hello,

I use linuxserver.io nginx container for a reverse proxy and I came upon a challenge I hadn’t faced before.

For those of you who don’t know the container above comes pre-configured with a modular http context and you add the services you want in small .conf files which describe the server and most popular services already have samples.

I created a wildcard certificate for *.example.internal for the reverse proxy which covered my needs for whenever I needed a new service.

Now I want to add a service which requires its own TLS certificate. Let’s call it sso.example.internal

I figured out how to do it with the stream context but now the problem is that I can either have the http context or the stream context on port 443. Otherwise it complains that the address is already bound.

So far I can imagine 2 possible solutions:

a) use 2 different ports i.e 443 and 4443

b) use 2 nginx instances 1 with stream context only and 1 with http context only where both will listen on 443 port. I am thinking that this could only work if there was a separate subdomain i.e. sso.new.internal and *.example.internal. But this would also fail because the 2 reverse proxies would not be able to work on the same port 443 essentially having the same problem as a)

Is there a clever way to have both the http and stream context listen on 443.

Any help appreciated and happy holidays to all.