2

Is it possible to set up Nginx in such way, that on the same domain it will serve on two different ports, two different valid certificates both with HSTS?

Certificates are from different CA and for different applications. I would prefer to avoid moving one to a subdomain.

Is it possible?

  • If yes - how?
  • If no - why?
2

Yes. It works fine. Just add listen <port> ssl and the certificates to each server stanza:

server {
    listen          443 ssl;
    server_name     www.example.com;
    ssl_certificate www.example.com.crt;
    ...
}

server {
    listen          444  ssl;
    server_name     www.example.com;
    ssl_certificate www.example.com2.crt;
    ...
}

HSTS shouldn't cause problems but certificate pinning might.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.