Created
February 12, 2014 00:19
-
-
Save bricker/8947330 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
map $uri $site { | |
~^/about/jobs 0; | |
~^/accounts 0; | |
~^/admin 0; | |
~^/social-media 0; | |
~^/about/press 0; | |
~^/archive 0; | |
~^/in 0; | |
~^/network 0; | |
~^/specials/jackson/slideshow 0; | |
~^/specials/prison/letters 0; | |
~^/specials/salaries 0; | |
~^/specials/pumps-under-pressure/timeline.xml 0; | |
~^/sitemap 0; | |
default 1; | |
} | |
server { | |
listen 80 default_server; | |
server_name www.scpr.org; | |
access_log /web/logs/scpr-access.log; | |
error_log /web/logs/scpr-error.log; | |
location / { | |
passenger_enabled on; | |
if ($site = 0) { | |
# DJANGO | |
root /web/mercer/mercer/public/; | |
passenger_min_instances 4; | |
} | |
if ($site = 1) { | |
# RAILS | |
root /web/scprv4/current/public/; | |
rails_env "production"; | |
passenger_min_instances 4; | |
} | |
} | |
# Asset Caching | |
# Sprockets creates its own gzipped files | |
# So we just need to tell nginx to use it | |
location ~ ^/assets/ { | |
root /web/scprv4/current/public; | |
gzip_static on; | |
gzip_disable "MSIE [1-6].(?!.*SV1)"; | |
gzip_http_version 1.1; | |
gzip_vary on; | |
expires max; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment