Last active
April 28, 2019 12:19
-
-
Save mhemrg/6d5218fc967f03088f111467b8ae90ae to your computer and use it in GitHub Desktop.
Liara - Redirect to SSL with GZip enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzip on; | |
gzip_min_length 1000; | |
gzip_proxied expired no-cache no-store private auth; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
location / { | |
index index.html index.htm; | |
if ($scheme = http) { | |
return 301 https://www.$host$request_uri; | |
} | |
if ($host !~* ^www\.) { | |
return 301 https://www.$host$request_uri; | |
} | |
} |
Please try this:
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location / {
index index.html index.htm;
if ($scheme = http) {
return 301 https://www.$host$request_uri;
}
if ($host !~* ^www\.) {
return 301 https://www.$host$request_uri;
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
location / {
index index.html index.htm;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
if ($host !~* ^(www)) {
rewrite ^/(.*)$ https://www.hooshima.com/$1 permanent;
}
}