Last active
March 2, 2016 17:18
-
-
Save pedro108/b4fff3db8f33ac363b26 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 { | |
server unix:#{path_to_rails_app_current_root}/tmp/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server #{application.domain.name}; | |
keepalive_timeout 300; | |
client_max_body_size 4G; | |
root #{path_to_rails_app_current_root}/public; # Set this to the public folder location of your Rails application. | |
try_files $uri/index.html $uri.html $uri @unicorn; | |
location @unicorn { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded_Proto $scheme; | |
proxy_redirect off; | |
# This passes requests to unicorn, as defined in /etc/nginx/nginx.conf | |
proxy_pass http://unicorn; | |
proxy_read_timeout 300s; | |
proxy_send_timeout 300s; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment