Skip to content

Instantly share code, notes, and snippets.

@matagus
Created July 5, 2013 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matagus/5934876 to your computer and use it in GitHub Desktop.
Save matagus/5934876 to your computer and use it in GitHub Desktop.
server {
server_name www.sarasa.com sarasa.com;
if ($host != 'sarasa.com' ) {
rewrite ^/(.*)$ http://sarasa.com/$1 permanent;
}
# Serve an empty 1x1 gif _OR_ an error 204 (No Content) for favicon.ico
location = /favicon.ico {
empty_gif;
}
location /site_media {
autoindex on;
expires 30d;
alias /home/matagus/sarasa/site_media;
}
location ~* ^.+\.(xml|html|txt) {
root /home/matagus/sarasa/;
expires 1d;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 60;
proxy_read_timeout 300;
proxy_send_timeout 90;
proxy_pass http://localhost:8081/;
}
# what to serve if upstream is not available or crashes
#error_page 500 502 503 504 /media/50x.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment