I want to redirect all sites and subdomains to one https domain name. I'll use https://my-site.com
as an example.
Previously I had all the redirection working with the following code:
server {
listen 80;
server_name my-site.com;
return 301 https://my-site.com$request_uri;
}
server {
listen 443 ssl spdy;
ssl on;
server_name my-site.com;
...
}
server {
listen 80;
server_name my-site.org;
return 301 https://my-site.com$request_uri;
}
server {
listen 80;
server_name subdomain1.my-site.com;
return 301 https://my-site.com/sites/subdomain1$request_uri;
}
Now I have two servers with an AWS Elastic Load Balancer. http://my-site.com
and https://my-site.com
both resolve to https://my-site.com
, but the other redirect rules are no longer being respected. Another thing possibly notable is that I'm using AWS Route 53 for DNS.
Thoughts anyone?