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