nginx ssl redirect
- by Lari13
I have SSL-sertificate for www. mydomain.com
How is the right config for nginx to get desired:
SSL request without www (https://mydomain.com/somefile) will be redirected to https://www. mydomain.com/somefile
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;
}