Skip to content

Instantly share code, notes, and snippets.

@nurulimamnotes
Created September 8, 2015 20:13
Show Gist options
  • Save nurulimamnotes/8f12ad908355a789c2c9 to your computer and use it in GitHub Desktop.
Save nurulimamnotes/8f12ad908355a789c2c9 to your computer and use it in GitHub Desktop.
user www-data;
worker_processes 2;
pid /run/nginx.pid;
worker_rlimit_nofile 10000;
events {
use epoll;
worker_connections 1024;
multi_accept on;
}
timer_resolution 500ms;
http {
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
reset_timedout_connection on;
send_timeout 2;
server_tokens off;
server_name_in_redirect on;
server_names_hash_bucket_size 128;
output_buffers 1 32k;
postpone_output 1460;
access_log off;
error_log /dev/null;
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=1r/s;
server {
limit_conn conn_limit_per_ip 10;
limit_req zone=req_limit_per_ip burst=10 nodelay;
}
client_body_timeout 3m;
client_header_timeout 3m;
client_body_buffer_size 128k;
client_header_buffer_size 3m;
large_client_header_buffers 4 256k;
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_disable "msie6";
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_min_length 10240;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_proxied expired no-cache no-store private auth;
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=staticfilecache:80m inactive=1d max_size=2500m;
proxy_temp_path /var/lib/nginx/temp;
proxy_connect_timeout 300;
proxy_read_timeout 120;
proxy_send_timeout 120;
proxy_buffer_size 16k;
proxy_buffers 4 16k;
include /etc/nginx/mime.types;
default_type application/octet-stream;
charset_types text/xml text/plain text/vnd.wap.wml application/x-javascript application/rss+xml text/css application/javascript application/json;
include /etc/nginx/production/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment