Created
April 17, 2011 10:53
-
-
Save mmiliaus/923938 to your computer and use it in GitHub Desktop.
nginx.conf to run nginx server which proxies to ruby daemon
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
upstream app { | |
server 127.0.0.1:4567; | |
} | |
server { | |
listen 80; | |
server_name 87.194.120.155; | |
access_log /var/log/nginx_access.log; | |
error_log /var/log/nginx_error.log; | |
location / { | |
root /home/flynn/projects/reloaded; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
if (-f $request_filename) { | |
break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://localhost:4567; | |
break; | |
} | |
} | |
# static content (images, flash, styles, etc.) | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|swf)$ { | |
root /home/flynn/projects/reloaded/public; | |
access_log off; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment