Hi
I'm trying for a while now and I've searched google, but I can't seem to find the right solution for my redirect problem.
I have a webserver running nginx, and I'm trying to get all subdomains linked tot this mailserver to redirect to https automatically.
the subdomains are
- mail
- mailserver
- webmail
- connect
I allready setup the correct multidomain certificate so that's handled. I have tried many server_name regexes but none of them work.
server_name ~^(mailserver|mail|connect|autodiscover|webmail)\.mydomainname\.com$;
rewrite ^ https://$server_name$request_uri? permanent;
But when I save this and try one of the above subomains, I just get this full server_name back in my browser address...
I am forgetting something or doing something wrong, but what? Please help...
I'm trying for a while now and I've searched google, but I can't seem to find the right solution for my redirect problem.
I have a webserver running nginx, and I'm trying to get all subdomains linked tot this mailserver to redirect to https automatically.
the subdomains are
- mailserver
- webmail
- connect
I allready setup the correct multidomain certificate so that's handled. I have tried many server_name regexes but none of them work.
server_name ~^(mailserver|mail|connect|autodiscover|webmail)\.mydomainname\.com$;
rewrite ^ https://$server_name$request_uri? permanent;
But when I save this and try one of the above subomains, I just get this full server_name back in my browser address...
I am forgetting something or doing something wrong, but what? Please help...