redirect subdomains other than www on port 443
Use a rewrite instead of redirect this time.
@@ -26,6 +26,10 @@ server {
server_name FQDN_OR_IP;
root /system/static/;
+ if ($http_host != "FQDN_OR_IP") {
+ rewrite ^/(.*) https://FQDN_OR_IP/$1 permanent;
+ }
+
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log debug;
