0

I have SSL-sertificate for www. mydomain.com
How is the right config for nginx to get desired:

This doesn't work, broser shows SSL-warning (wrong domain) :(

server
{
        listen  443 ssl;
        server_name mydomain.com;
        rewrite ^(.*) https://www.mydomain.com$1 permanent;
        ssl_certificate      intermediate.crt;
        ssl_certificate_key  www.mydomain.com.key;
}
Lari13
  • 285
  • 1
  • 3
  • 8

1 Answers1

0

Since ssl handshake and certificate check occurs before any HTTP communication there is no way to make redirect without browser's warning.

Vadim
  • 1,339
  • 9
  • 8