Skip to content

Instantly share code, notes, and snippets.

@altan-me
Last active January 21, 2016 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altan-me/e184f8af116da94be264 to your computer and use it in GitHub Desktop.
Save altan-me/e184f8af116da94be264 to your computer and use it in GitHub Desktop.
nginx config
user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_priority 15;
worker_rlimit_nofile 1024;
events {
worker_connections 512;
multi_accept on;
accept_mutex_delay 500ms;
use epoll;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
# Log Errors
error_log /var/log/nginx/error.log;
# Timeouts, do not keep connections open longer then necessary to reduce
# resource usage and deny Slowloris type attacks.
keepalive_timeout 20;
client_header_timeout 20;
client_body_timeout 20;
reset_timedout_connection on;
send_timeout 20;
#Limit for Fail2ban
#limit_req_zone $binary_remote_addr zone=app:10m rate=2r/s;
# Max Allowed Connections per IP
limit_conn_zone $binary_remote_addr zone=addr:5m;
limit_conn addr 100;
include /etc/nginx/mime.types;
default_type text/html;
charset UTF-8;
# Gzip Settings
gzip on;
gzip_proxied any;
gzip_min_length 256;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Cache informations about file descriptors, frequently accessed files
open_file_cache max=100000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
# Virtual Host Configs
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment