Created
March 9, 2009 01:16
-
-
Save grantmichaels/76032 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
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
server_names_hash_bucket_size 64; | |
# configure log format | |
log_format main '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
#main error.log | |
error_log /usr/local/nginx/logs/error.log; | |
sendfile on; | |
tcp_nopush on; | |
#keepalive_timeout 65; | |
tcp_nodelay off; | |
gzip on; | |
gzip_comp_level 2; | |
gzip_proxied any; | |
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml | |
application/xml+rss text/javascript; | |
upstream mochiweb1 { | |
server 127.0.0.1:8000; | |
} | |
upstream mochiweb2 { | |
server 127.0.0.1:4000; | |
} | |
server { | |
listen :80 default deferred; | |
location /home/deploy/grantmichaels/priv/www/ { | |
server_name www.grantmichaels.com grantmichaels.com; | |
proxy_pass http://mochiweb1/; | |
root /home/deploy/grantmichaels/priv/www; | |
index index.html index.htm; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect false; | |
if (-f $request_filename/index.html) { | |
rewrite (.*) $1/index.html break; | |
} | |
if (-f $request_filename.html) { | |
rewrite (.*) $1.html break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://mochiweb1; | |
break; | |
} | |
} | |
location /home/deploy/plumbingholes/priv/www/ { | |
server_name www.grantmichaels.com grantmichaels.com; | |
proxy_pass http://mochiweb2/; | |
root /home/deploy/plumbingholes/priv/www; | |
index index.html index.htm; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect false; | |
if (-f $request_filename/index.html) { | |
rewrite (.*) $1/index.html break; | |
} | |
if (-f $request_filename.html) { | |
rewrite (.*) $1.html break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://mochiweb2; | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment