Last active
August 29, 2015 14:04
-
-
Save orafaelfragoso/f3c58ab9ec49b877ab0a to your computer and use it in GitHub Desktop.
Nginx Production Configuration
This file contains hidden or 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 { | |
server unix:/tmp/unicorn.carelinked.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default_server; | |
client_max_body_size 4G; | |
root /home/USER/APP/current/public; | |
try_files $uri/index.html $uri @unicorn; | |
# Make site accessible from http://localhost/ | |
server_name app.com www.app.com; | |
location ~* ^/assets/ { | |
root /home/USER/APP/current/public; | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
} | |
location ~ \.(js|css|png|jpg|jpeg|gif|ico|html|woff|ttf|svg|eot|otf)$ { | |
add_header "Access-Control-Allow-Origin" "*"; | |
expires 1M; | |
access_log off; | |
add_header Cache-Control "public"; | |
} | |
location @unicorn { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://unicorn; | |
} | |
#error_page 500 502 503 504 /500.html; | |
#location = /500.html { | |
# /home/USER/APP/current/public; | |
#} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment