Created
July 5, 2013 14:23
-
-
Save matagus/5934876 to your computer and use it in GitHub Desktop.
This file contains 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
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