X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=etc%2Fnginx%2Fnginx.conf;fp=etc%2Fnginx%2Fnginx.conf;h=fc2e23d53c71512a485f458b1fd4b52065bd7389;hb=ac6452c7821434c9750210bf75a95e51d876dc3d;hp=0000000000000000000000000000000000000000;hpb=deeba8cf50893362d5af7bed3e94119e430af487;p=lhc%2Fateliers.git diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf new file mode 100644 index 0000000..fc2e23d --- /dev/null +++ b/etc/nginx/nginx.conf @@ -0,0 +1,85 @@ +events { + multi_accept on; + use epoll; + worker_connections 1024; + } +http { + log_format main + '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" nocache:$no_cache'; + access_log /var/log/nginx/access.log main buffer=32k; + client_body_buffer_size 4K; + # NOTE: % getconf PAGESIZE + # 4096 + client_body_temp_path /run/shm/cache/nginx/client_body 1 2; + client_body_timeout 60; + client_header_buffer_size 1k; + client_header_timeout 60; + client_max_body_size 20m; + default_type application/octet-stream; + error_log /var/log/nginx/error.log warn; + error_page 403 = 404; + fastcgi_cache_key "$request_method $scheme://$host$request_uri"; + fastcgi_cache_path /run/shm/cache/nginx/fastcgi + levels=1:2 + keys_zone=microcache:10m + inactive=5m + max_size=64m; + gzip on; + gzip_buffers 16 8k; + gzip_comp_level 6; + gzip_disable "MSIE [1-6]\."; + gzip_http_version 1.1; + gzip_min_length 1024; + gzip_proxied any; + gzip_static on; + gzip_vary on; + gzip_types + application/javascript + application/json + application/rss+xml + application/vnd.ms-fontobject + application/x-font-ttf + application/x-javascript + application/xml + application/xml+rss + font/opentype + font/truetype + image/svg+xml + text/css + text/javascript + text/plain + text/x-component + text/xml; + include /etc/nginx/mime.types; + keepalive_timeout 20; + large_client_header_buffers 4 8k; + open_file_cache max=200000 inactive=20s; + open_file_cache_errors on; + open_file_cache_min_uses 2; + open_file_cache_valid 30s; + open_log_file_cache max=1000 inactive=20s min_uses=2 valid=1m; + proxy_cache_use_stale updating; + reset_timedout_connection on; + send_timeout 60; + # NOTE: if the client stops reading data, free up the stale client connection after this much time. + sendfile on; + server_names_hash_bucket_size 128; + server_tokens off; + tcp_nodelay on; + # NOTE: don't buffer data-sends (disable Nagle algorithm). + # Good for sending frequent small bursts of data in real time. + tcp_nopush on; + # NOTE: causes nginx to attempt to send its HTTP response head in one packet, + # instead of using partial frames. + # This is useful for prepending headers before calling sendfile, + # or for throughput optimization. + types_hash_max_size 2048; + include /etc/nginx/site.d/*/server.conf; + } +pid /var/run/nginx.pid; +user www-data; +worker_processes 2; + +# vim: ft=sh