Created
February 6, 2013 16:14
-
-
Save nacengineer/4723675 to your computer and use it in GitHub Desktop.
Basic Unicorn nginx init.d file
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 mysite { | |
server unix:/etc/unicorn/sockets/mysite.socket fail_timeout=0; | |
} | |
server { | |
client_max_body_size 2M; | |
keepalive_timeout 5; | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/mysite_access.log; | |
error_log /var/log/nginx/mysite_error.log; | |
rewrite_log on; | |
# path for static files | |
root /var/rails/unicorn/mysite/public; | |
location / { | |
try_files $uri $uri/index.html $uri.html @mysite; | |
} | |
location @mysite { | |
proxy_read_timeout 300; | |
proxy_connect_timeout 300; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_pass http://mysite; | |
} | |
location ~ \.php$ { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment