I am using Ubuntu 14.04 with nginx installed and SSL installed on main domain, which works fine. I have even parked 5-6 other domains with main domain. If I go to any of those domains, I get an SSL warning because I have forced HTTPS in nginx config using following config:
I have added following in
return 302 https://$host$request_uri;
And this correctly forces the HTTPS version to be served.
How could I implement some condition such as: if domain is
main.example.com then redirect to HTTPS version, otherwise show HTTP version?