Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:190084
Created Sep 21, 2009

worker_processes 1;
events {
worker_connections 1024;
use kqueue; # OS X
# use epoll; # Linux
}
http {
include /usr/local/nginx/nginx.mime.types;
default_type application/octet-stream;
access_log logs/mysite.access.log ;
error_log logs/mysite.error.log;
## Size Limits
client_body_buffer_size 64k;
client_header_buffer_size 1k;
client_max_body_size 1M;
large_client_header_buffers 1 1k;
## Timeouts
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 10 15;
send_timeout 10;
## General Options
ignore_invalid_headers on;
limit_zone gulag $binary_remote_addr 1m;
recursive_error_pages on;
sendfile on;
server_name_in_redirect off;
server_tokens off;
## Compression
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 9;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_vary on;
## TCP options
tcp_nodelay on;
tcp_nopush on;
## Log Format
log_format main '$remote_addr $host $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" "$gzip_ratio"';
## Increase max length of domain names
server_names_hash_bucket_size 64;
## Redirect www to top-level.
server {
listen 80;
server_name www.localhost;
rewrite ^/(.*) http://localhost permanent;
}
## Main configuration
server {
listen 80;
server_name localhost;
location ~ ^/public/js/jquery(.*) {
if (-f $request_filename) {
break;
}
}
## Paster Cluster configuration
location / {
fastcgi_pass 127.0.0.1:6500;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment