rewrite_log on; error_log /c2290/log/rewrite.log notice; # subdomain rewrites if ($host = "example.domain.com") { rewrite ^ https://www.domain.com/pages/example/$uri permanent; } location ~* \.(jpg|jpeg|png|gif|ico|css|js|webm|ogv|mp4)$ { expires 20d; } # Tells the browser to always force SSL. # add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; if ($scheme != "https") { rewrite ^ https://www.domain.com$uri permanent; } if ($host != "www.domain.com") { rewrite ^ https://www.domain.com$uri permanent; } location / { try_files $uri $uri/ @modx-rewrite; }
This question has been answered by smorris. See the first response.
if ($scheme != "https") { rewrite ^ https://www.domain.com$uri permanent; }
if ($scheme != "https") { rewrite ^ https://$host$uri permanent; }
I suck at NGINX rules, to be truthful, but first glance it seems like any non https request is going to get routed to your primary domain, at which point, it's no longer a request for your subdomain. I think you could change:
No response from my redirected subdomain a-records.
Yeah, those were stupid questions, as I read your original post it looks like everything was running fine until the introduction of https. Just thinking here, but the site_url context setting for each context should be updated to include the https, I assume you've done that already?
if ($host != "www.domain.com") { rewrite ^ https://www.domain.com$uri permanent; }
if ($scheme != "https") { rewrite ^ https://$host$uri permanent; } if ($host = "domain.com") { return 301 $scheme://www.domain.com$request_uri; } location / { try_files $uri $uri/ @modx-rewrite; }