1 # DOC: http://blog.martinfjordvald.com/2010/07/nginx-primer/
5 worker_connections 1024;
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
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;
24 fastcgi_cache_key "$request_method $scheme://$http_host$request_uri";
25 fastcgi_cache_path /run/shm/cache/nginx/fastcgi
27 keys_zone=microcache:2M
31 loader_threshold=2592000000
33 fastcgi_temp_path /run/shm/tmp/nginx/ 1 2;
37 gzip_disable "MSIE [1-6]\.";
38 gzip_http_version 1.1;
44 application/javascript
47 application/vnd.ms-fontobject
48 application/x-font-ttf
49 application/x-javascript
60 include /etc/nginx/mime.types;
62 large_client_header_buffers 4 8k;
63 map_hash_bucket_size 128;
64 open_file_cache max=200000 inactive=20s;
65 open_file_cache_errors on;
66 open_file_cache_min_uses 2;
67 open_file_cache_valid 30s;
68 open_log_file_cache max=1000 inactive=20s min_uses=2 valid=1m;
69 proxy_cache_use_stale updating;
70 proxy_temp_path /run/shm/cache/nginx/proxy_temp 1 2;
71 reset_timedout_connection on;
73 # NOTE: if the client stops reading data, free up the stale client connection after this much time.
75 server_names_hash_bucket_size 128;
77 ssl_session_cache shared:SSL:10m;
79 # NOTE: don't buffer data-sends (disable Nagle algorithm).
80 # Good for sending frequent small bursts of data in real time.
82 # NOTE: causes nginx to attempt to send its HTTP response head in one packet,
83 # instead of using partial frames.
84 # This is useful for prepending headers before calling sendfile,
85 # or for throughput optimization.
86 types_hash_max_size 2048;
87 map $http_user_agent $bad_bot {
88 # NOTE: user agents that are to be blocked.
91 ~(?i)(httrack|htmlparser|libwww) 1;
93 #map $http_referer $bad_referer {
94 # # NOTE: referrers that are to be blocked.
96 # ~(?i)(babes|casino|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|replica|sex|teen|webcam|zippo) 1;
102 include /etc/nginx/site.d/*/http.conf;
103 include /etc/nginx/site.d/*/server.conf;
105 listen 80 default_server;
107 return 302 $scheme://heureux-cyclage.org$request_uri;
110 listen 443 default_server;
112 include /etc/nginx/conf.d/ssl.conf;
113 ssl_certificate /etc/nginx/x509.d/cyclo-www-tls/crt.pem;
114 ssl_certificate_key /etc/nginx/x509.d/cyclo-www-tls/key.pem;
115 return 302 $scheme://cyclocoop.org$request_uri;