Ticket #64: nginx.conf

File nginx.conf, 1.3 KB (added by Vladimir Protasov, 15 years ago)

Nginx configuration

Line 
1worker_processes 1;
2
3events {
4 worker_connections 1024;
5}
6
7http {
8 include mime.types;
9 default_type application/octet-stream;
10
11 log_format debuglog '[$time_local] "$request" $status $body_bytes_sent "$upstream_addr ($upstream_status)"';
12
13 access_log /var/log/nginx/access.debug.log debuglog;
14 error_log /var/log/nginx/errors.debug.log debug;
15
16 sendfile on;
17 tcp_nopush on;
18 keepalive_timeout 70 30;
19 reset_timedout_connection on;
20
21 # Upstreams
22 upstream tst {
23 server 127.0.0.1:8080 max_fails=3 fail_timeout=60s; # Alive
24 server 10.76.0.40:6666 max_fails=3 fail_timeout=60s; # Dead (port not binded)
25 server 10.76.0.40:7777 max_fails=3 fail_timeout=60s; # Dead (port not binded)
26 }
27
28 server {
29 listen 80 default;
30 server_name localhost;
31
32 access_log /var/log/nginx/access.80.debug.log debuglog;
33 error_log /var/log/nginx/errors.80.debug.log debug;
34
35 proxy_connect_timeout 5s;
36 location /tst {
37 proxy_pass http://tst;
38 }
39 }
40
41 server {
42 listen 8080;
43 server_name _;
44
45 access_log /var/log/nginx/access.8080.debug.log debuglog;
46 error_log /var/log/nginx/errors.8080.debug.log debug;
47
48 location / {
49 default_type text/plain;
50 empty_gif;
51 }
52 }
53}