Skip to content

Instantly share code, notes, and snippets.

@mhemrg
Last active April 28, 2019 12:19
Show Gist options
  • Save mhemrg/6d5218fc967f03088f111467b8ae90ae to your computer and use it in GitHub Desktop.
Save mhemrg/6d5218fc967f03088f111467b8ae90ae to your computer and use it in GitHub Desktop.
Liara - Redirect to SSL with GZip enabled
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;
}
}
@sadaghiani
Copy link

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;
}

}

@mhemrg
Copy link
Author

mhemrg commented Apr 28, 2019

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