Skip to content

Instantly share code, notes, and snippets.

@parente
Created March 26, 2010 19:38
Show Gist options
  • Save parente/345291 to your computer and use it in GitHub Desktop.
Save parente/345291 to your computer and use it in GitHub Desktop.
sample nginx.conf
#user nginx;
worker_processes 5;
error_log /opt/local/var/log/nginx/error.log;
pid /opt/local/var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Enumerate all the Tornado servers here
upstream jsonic {
server 127.0.0.1:8888;
}
access_log /opt/local/var/log/nginx/access.log;
include /opt/local/etc/nginx/mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
proxy_read_timeout 200;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
autoindex on;
gzip_types text/plain text/html text/css text/xml
application/x-javascript application/xml
application/atom+xml text/javascript;
# Only retry if there was a communication error, not a timeout
# on the Tornado server (to avoid propagating "queries of death"
# to all frontends)
proxy_next_upstream error;
server {
listen 80;
server_name helios;
location /~parente {
alias /Users/parente/Sites;
}
location /jsonic/static {
alias /Users/parente/projects/jsonic;
}
location /jsonic/files {
alias /Users/parente/projects/jsonic/server/files;
}
location /jsonic/ {
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://jsonic/;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment