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