Created
October 21, 2014 08:31
-
-
Save flyerhzm/0d836d8e60d5673872b7 to your computer and use it in GitHub Desktop.
nginx with unicorn conf
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 codingstyleguide_upstream { | |
server unix:///home/deploy/sites/codingstyleguide/production/shared/tmp/sockets/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name codingstyleguide-assets.xinminlabs.com; | |
access_log /var/log/nginx/codingstyleguide-asset.log; | |
error_log /var/log/nginx/codingstyleguide-error.log; | |
root /home/deploy/sites/codingstyleguide/production/current/public; | |
# expires headers | |
location ~ ^/assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
break; | |
} | |
} | |
server { | |
listen 80; | |
server_name codingstyleguide.xinminlabs.com; | |
access_log /var/log/nginx/codingstyleguide-access.log; | |
error_log /var/log/nginx/codingstyleguide-error.log; | |
root /home/deploy/sites/codingstyleguide/production/current/public; | |
# expires headers | |
location ~ ^/assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
break; | |
} | |
location / { | |
proxy_redirect off; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $http_host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header Host $http_host; | |
proxy_pass http://codingstyleguide_upstream; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment