Anonymous (owner)

Revisions

  • fdde06 Sun Sep 20 22:17:45 -0700 2009
gist: 190084 Download_button fork
public
Public Clone URL: git://gist.github.com/190084.git
Embed All Files: show embed
Bash #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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;
      }
 
    }
 
}