diff --git a/zoneminder/includes/nginx.conf b/zoneminder/includes/nginx.conf new file mode 100644 index 0000000..938d3a2 --- /dev/null +++ b/zoneminder/includes/nginx.conf @@ -0,0 +1,93 @@ +load_module /usr/local/libexec/nginx/ngx_mail_module.so; +load_module /usr/local/libexec/nginx/ngx_stream_module.so; + +user www; +worker_processes auto; + +pid /var/run/nginx.pid; + +events { + use kqueue; + worker_connections 1024; + multi_accept on; +} +http { + + # Basic settings + # ---------- + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + reset_timedout_connection on; + keepalive_timeout 65; + keepalive_requests 1000; + types_hash_max_size 2048; + server_tokens off; + send_timeout 30; + server_names_hash_max_size 4096; + + # Common limits + # ---------- + + client_max_body_size 100m; # upload size + client_body_buffer_size 1m; + client_header_timeout 3m; + client_body_timeout 3m; + + client_body_temp_path /var/tmp/nginx/client_body_temp; + + proxy_connect_timeout 5; + proxy_send_timeout 10; + proxy_read_timeout 10; + + proxy_buffer_size 4k; + proxy_buffers 8 16k; + proxy_busy_buffers_size 64k; + proxy_temp_file_write_size 64k; + + proxy_temp_path /var/tmp/nginx/proxy_temp; + + include mime.types; + default_type application/octet-stream; + + # Logs format + # ---------- + + log_format main '$remote_addr - $host [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"' + 'rt=$request_time ut=$upstream_response_time ' + 'cs=$upstream_cache_status'; + + log_format cache '$remote_addr - $host [$time_local] "$request" $status ' + '$body_bytes_sent "$http_referer" ' + 'rt=$request_time ut=$upstream_response_time ' + 'cs=$upstream_cache_status'; + + access_log /var/log/nginx/access.log main; + error_log /var/log/nginx/error.log warn; + + # GZip config + # ---------- + + gzip on; + gzip_static on; + gzip_types text/plain text/css text/javascript text/xml application/x-javascript application/javascript application/xml application/json image/x-icon; + gzip_comp_level 9; + gzip_buffers 16 8k; + gzip_proxied expired no-cache no-store private auth; + gzip_min_length 1000; + gzip_disable "msie6" + gzip_vary on; + + # Cache config + # ---------- + + proxy_cache_valid 1m; + + # Virtual host config + # ---------- + + include /usr/local/etc/nginx/conf.d/*.conf; +}