Modification : vm_hosted : insserv -> runit .
[lhc/ateliers.git] / etc / nginx / nginx.conf
1 # DOC: http://blog.martinfjordvald.com/2010/07/nginx-primer/
2 events {
3 multi_accept on;
4 use epoll;
5 worker_connections 1024;
6 }
7 http {
8 log_format main
9 '$remote_addr - $remote_user [$time_local] "$request" '
10 '$status $body_bytes_sent "$http_referer" '
11 '"$http_user_agent" "$http_x_forwarded_for"';
12 access_log /var/log/nginx/access.log main buffer=32k;
13 client_body_buffer_size 4K;
14 # NOTE: % getconf PAGESIZE
15 # 4096
16 client_body_temp_path /run/shm/cache/nginx/client_body 1 2;
17 client_body_timeout 60;
18 client_header_buffer_size 1k;
19 client_header_timeout 60;
20 client_max_body_size 20m;
21 default_type application/octet-stream;
22 error_log /var/log/nginx/error.log warn;
23 error_page 403 = 404;
24 fastcgi_cache_key "$request_method $scheme://$host$request_uri";
25 fastcgi_cache_path /run/shm/cache/nginx/fastcgi
26 levels=1:2
27 keys_zone=microcache:10m
28 inactive=5m
29 max_size=64m;
30 fastcgi_cache microcache;
31 gzip on;
32 gzip_buffers 16 8k;
33 gzip_comp_level 6;
34 gzip_disable "MSIE [1-6]\.";
35 gzip_http_version 1.1;
36 gzip_min_length 1024;
37 gzip_proxied any;
38 gzip_static on;
39 gzip_vary on;
40 gzip_types
41 application/javascript
42 application/json
43 application/rss+xml
44 application/vnd.ms-fontobject
45 application/x-font-ttf
46 application/x-javascript
47 application/xml
48 application/xml+rss
49 font/opentype
50 font/truetype
51 image/svg+xml
52 text/css
53 text/javascript
54 text/plain
55 text/x-component
56 text/xml;
57 include /etc/nginx/mime.types;
58 keepalive_timeout 20;
59 large_client_header_buffers 4 8k;
60 open_file_cache max=200000 inactive=20s;
61 open_file_cache_errors on;
62 open_file_cache_min_uses 2;
63 open_file_cache_valid 30s;
64 open_log_file_cache max=1000 inactive=20s min_uses=2 valid=1m;
65 proxy_cache_use_stale updating;
66 reset_timedout_connection on;
67 send_timeout 60;
68 # NOTE: if the client stops reading data, free up the stale client connection after this much time.
69 sendfile on;
70 server_names_hash_bucket_size 128;
71 server_tokens off;
72 tcp_nodelay on;
73 # NOTE: don't buffer data-sends (disable Nagle algorithm).
74 # Good for sending frequent small bursts of data in real time.
75 tcp_nopush on;
76 # NOTE: causes nginx to attempt to send its HTTP response head in one packet,
77 # instead of using partial frames.
78 # This is useful for prepending headers before calling sendfile,
79 # or for throughput optimization.
80 types_hash_max_size 2048;
81 include /etc/nginx/site.d/*/server.conf;
82 }
83 pid /run/nginx.pid;
84 user www-data;
85 worker_processes 2;
86
87 # vim: ft=sh