# /etc/nginx/nginx.conf # Do not start as daemon daemon off; worker_processes auto; worker_rlimit_nofile 100000; # Set log to stderr error_log stderr warn; pid #NGINX_RUN_DIR#/nginx.pid; include /etc/nginx/modules/*.conf; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; server_tokens off; keepalive_timeout 15; sendfile on; tcp_nodelay on; log_format custom_log '[$time_local] [NGINX] - $remote_addr - $remote_user - ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"'; # Log access to stdout access_log /dev/stdout custom_log; # SSL ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:2m; # buffering causes issues, disable it # increase buffer size. still useful even when buffering is off proxy_buffering off; proxy_buffer_size 4k; # Buffer size client_body_buffer_size 10k; client_header_buffer_size 1k; client_max_body_size 8m; large_client_header_buffers 2 1k; # Timeouts client_body_timeout 12; client_header_timeout 12; send_timeout 10; # GZip Compression gzip on; gzip_http_version 1.0; gzip_vary on; gzip_comp_level 4; gzip_min_length 1280; gzip_buffers 128 4k; # gzip_proxied expired no-cache no-store private auth; gzip_proxied any; gzip_disable "msie6"; # gzip_types text/plain application/x-javascript text/xml text/css application/xml; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp; server { listen 80 default_server; listen [::]:80 default_server; server_name _; root #NGINX_ROOT_DIR#; index index.html; error_log stderr warn; location / { try_files $uri $uri/ index.html; } #NGINX_ENABLE_STATIC_CACHE#location ~* .(jpg|jpeg|png|gif|ico|css|js|flv|mp4)$ { #NGINX_ENABLE_STATIC_CACHE# expires 30d; #NGINX_ENABLE_STATIC_CACHE#} #NGINX_ENABLE_STUB#location /nginx-status { #NGINX_ENABLE_STUB# stub_status on; #NGINX_ENABLE_STUB# allow all; #NGINX_ENABLE_STUB#} } include /etc/nginx/conf.d/*.conf; }