Created
October 1, 2013 10:57
-
-
Save universal/6776825 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 some.where { | |
server unix:/home/somewhere/deploy/somewhere/tmp/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name some.where www.some.where; | |
location / { | |
return 301 https://some.where$request_uri; | |
} | |
} | |
server { | |
listen 443 ssl; | |
server_name some.where www.some.where; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl_certs/startssl/some.where.ssl.chained.crt; | |
ssl_certificate_key /etc/nginx/ssl_certs/startssl/some.where.ssl.key; | |
location / { | |
#all requests are sent to the UNIX socket | |
proxy_pass http://some.where; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto https; | |
} | |
location ~ ^/(assets|uploads)/ { | |
root /home/somewhere/deploy/somewhere/public; | |
expires max; | |
add_header Cache-Control public; | |
add_header ETag ""; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment