Skip to content

Instantly share code, notes, and snippets.

@eignatov
Created January 26, 2016 14:08
Show Gist options
  • Select an option

  • Save eignatov/e1a0a865320c037b2865 to your computer and use it in GitHub Desktop.

Select an option

Save eignatov/e1a0a865320c037b2865 to your computer and use it in GitHub Desktop.
My general Nginx config
# user http;
# user www-data;
worker_processes 4;
# [ debug | info | notice | warn | error | crit ]
error_log /var/log/nginx/error.log warn;
events {
worker_connections 1024;
# use [ kqueue | rtsig | epoll | /dev/poll | select | poll ];
use epoll;
}
http {
##
# Basic Settings
##
include mime.types;
default_type application/octet-stream;
# off | on
server_tokens on;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_header_buffer_size 1k;
large_client_header_buffers 4 4k;
client_max_body_size 10m;
types_hash_max_size 8048;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
##
# Logs
##
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
##
# Gzip
##
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k; # 16 8k
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_http_version 1.1;
server {
server_name _ "";
access_log off;
log_subrequest off;
log_not_found off;
return 444;
}
##
# Virtual Host Configs
##
include /srv/http/*/nginx.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment