Created
March 1, 2013 10:39
-
-
Save davidnorth/5063830 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
upstream unicorn_myapp { | |
server unix:/data/myapp/shared/sockets/unicorn.sock fail_timeout=0; | |
} | |
server | |
listen 80; | |
client_max_body_size 4G; | |
server_name _; | |
keepalive_timeout 5; | |
root /data/myapp/current/public; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
if (!-f $request_filename) { | |
proxy_pass http://unicorn_myapp; | |
break; | |
} | |
} | |
location ~* ^/assets { | |
expires max; | |
add_header Cache-Control public; | |
break; | |
} | |
error_page 500 502 503 504 /500.html; | |
location = /500.html { | |
root /data/myapp/current/public; | |
} | |
} | |
server { | |
listen 443; | |
server_name myapp.mydomain.com; | |
ssl on; | |
ssl_certificate /etc/ssl/myapp.crt; | |
ssl_certificate_key /etc/ssl/myapp.key; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_ciphers ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT; | |
root /data/myapp/current/public; | |
location / { | |
proxy_set_header X_FORWARDED_PROTO https; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Url-Scheme $scheme; | |
proxy_max_temp_file_size 0; | |
proxy_redirect off; | |
if (!-f $request_filename) { | |
proxy_pass http://unicorn_myapp; | |
break; | |
} | |
} | |
location ~* ^/assets { | |
expires max; | |
add_header Cache-Control public; | |
break; | |
} | |
error_page 500 502 503 504 /500.html; | |
location = /500.html { | |
root /data/myapp/current/public; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment