Project

General

Profile

Defect #11277 » nginx.conf

Kyle Merchant, 2012-06-27 15:59

 
1

    
2
user _nginx;
3
worker_processes  1;
4

    
5
# Paths specified here (unless absolute), will be relative to 
6
# /etc/nginx. If not specified, defaults to /var/log/nginx/...
7
#error_log  logs/error.log;
8
#error_log  logs/error.log  notice;
9
#error_log  logs/error.log  info;
10

    
11
#pid        logs/nginx.pid;
12

    
13

    
14
events {
15
    worker_connections  1024;
16
    accept_mutex off;
17
}
18

    
19

    
20
http {
21
    include       mime.types;
22
    default_type  application/octet-stream;
23

    
24
    server_tokens off;
25

    
26
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
27
    #                  '$status $body_bytes_sent "$http_referer" '
28
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
29

    
30
    #access_log  logs/access.log  main;
31

    
32
    sendfile        on;
33
    tcp_nopush     on;
34

    
35
    keepalive_timeout  65;
36

    
37
    #gzip  on;
38
    
39
    server {
40
        listen       80;
41
        server_name  ruby.bstsys.local;
42
        root /home/kyle/redmine-1.4/public;
43

    
44
        #charset koi8-r;
45

    
46
        #access_log  logs/host.access.log  main;
47

    
48
        location / {
49
                try_files $uri @unicorn;
50
        }
51

    
52
        location @unicorn {
53
		        #proxy_set_header X-Real-IP $remote_addr;
54
                proxy_set_header X-Forwarded-For $remote_addr;
55
                proxy_set_header Host $http_host;
56
                proxy_redirect off;
57
                proxy_read_timeout 60;
58
                proxy_pass http://unix:/home/kyle/redmine-1.4/tmp/sockets/.unicorn.sock;
59
        }
60

    
61
        error_page  404              /404.html;
62
        error_page  500 502 503 504  /500.html;
63

    
64
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
65
        #
66
        #location ~ \.php$ {
67
        #    proxy_pass   http://127.0.0.1;
68
        #}
69

    
70
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
71
        # Make sure you let php-fastcgi know which port. Running it
72
        # with '-b 127.0.0.1:9000' will do.
73
        #
74
        #location ~ \.php$ {
75
        #    root           /var/nginx/html;
76
        #    fastcgi_pass   127.0.0.1:9000;
77
        #    fastcgi_index  index.php;
78
        #    fastcgi_param  SCRIPT_FILENAME $document_root/$fastcgi_script_name;
79
        #    include        fastcgi_params;
80
        #}
81

    
82
        # deny access to .htaccess files, if Apache's document root
83
        # concurs with nginx's one
84
        #
85
        #location ~ /\.ht {
86
        #    deny  all;
87
        #}
88
    }
89

    
90

    
91
    # another virtual host using mix of IP-, name-, and port-based configuration
92
    #
93
    #server {
94
    #    listen       8000;
95
    #    listen       somename:8080;
96
    #    server_name  somename  alias  another.alias;
97

    
98
    #    location / {
99
    #        root   /var/nginx/html;
100
    #        index  index.html index.htm;
101
    #    }
102
    #}
103

    
104

    
105
    # HTTPS server
106
    #
107
    #server {
108
    #    listen       443;
109
    #    server_name  localhost;
110

    
111
    #    ssl                  on;
112
    #    ssl_certificate      cert.pem;
113
    #    ssl_certificate_key  cert.key;
114

    
115
    #    ssl_session_timeout  5m;
116

    
117
    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
118
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
119
    #    ssl_prefer_server_ciphers   on;
120

    
121
    #    location / {
122
    #        root   /var/nginx/html;
123
    #        index  index.html index.htm;
124
    #    }
125
    #}
126

    
127
}
(1-1/2)