Skip to content

Instantly share code, notes, and snippets.

@andxyz
Created March 6, 2014 20:28
Show Gist options
  • Save andxyz/9398953 to your computer and use it in GitHub Desktop.
Save andxyz/9398953 to your computer and use it in GitHub Desktop.
# tips http://wiki.nginx.org/Pitfalls
#
server {
listen 80;
server_name www.andxyz.com;
rewrite ^ http://andxyz.com$request_uri? permanent;
}
server {
listen 80;
server_name andxyz.com linode.andxyz.com *.andxyz.com;
root /home/wwwandxyz/website/;
server_tokens off;
location / {
access_log off;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml;
gzip_disable "MSIE [1-6]\.";
if (-f $request_filename) {
access_log off;
expires 24h;
break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment