0

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?

tim peterson
  • 693
  • 2
  • 9
  • 18
  • Did you mean `subdomain1.my-site.org` instead `subdomain1.my-site`? – masegaloeh May 09 '14 at 01:24
  • sorry I left off the ".com". Thanks for spotting this mistake. I corrected the question. I think this is and Elastic Load Balancer issue. http://developer24hours.blogspot.com/2013/02/elastic-load-balancer-and-nginx-how-to.html – tim peterson May 09 '14 at 05:24

0 Answers0