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