Skip to content

Instantly share code, notes, and snippets.

@laughingman7743
Last active August 29, 2015 14:05
Show Gist options
  • Save laughingman7743/028b7122f23af173ba4b to your computer and use it in GitHub Desktop.
Save laughingman7743/028b7122f23af173ba4b to your computer and use it in GitHub Desktop.
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 8;
worker_rlimit_nofile 81920;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 10240;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format custom '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $request_time '
'$upstream_response_time $upstream_addr';
log_format ltsv 'host:$remote_addr\t'
'user:$remote_user\t'
'time:$time_local\t'
'time_msec:$msec\t'
'method:$request_method\t'
'path:$request_uri\t'
'status:$status\t'
'size:$body_bytes_sent\t'
'referer:$http_referer\t'
'agent:$http_user_agent\t'
'response:$request_time\t'
'upstream_response:$upstream_response_time\t'
'upstream_host:$upstream_addr';
access_log /var/log/nginx/access.log ltsv;
## General Options
ignore_invalid_headers off;
#keepalive_timeout 30;
#keepalive_requests 10240;
keepalive_timeout 0;
keepalive_requests 0;
#recursive_error_pages on;
server_name_in_redirect off;
server_tokens off;
sendfile on;
#aio on;
output_buffers 1 512k;
tcp_nodelay on;
tcp_nopush on;
client_body_timeout 30;
client_header_timeout 30;
#expires 24h;
send_timeout 30;
client_max_body_size 102400m;
reset_timedout_connection on;
server_names_hash_bucket_size 512;
## Compression
gzip on;
gzip_buffers 16 64k;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;
## Cache
#open_file_cache max=1024 inactive=30s;
#open_file_cache_valid 60s;
#open_file_cache_min_uses 2;
#open_file_cache_errors on;
## SSL
ssl_session_cache shared:SSL:256m;
ssl_session_timeout 10m;
## Proxy
proxy_buffering on;
proxy_buffer_size 64k;
proxy_buffers 16 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
proxy_cache_path /var/tmp/nginx/cache levels=1:2 keys_zone=proxy-cache:10m max_size=100m inactive=1d;
proxy_temp_path /var/tmp/nginx/tmp;
proxy_ignore_client_abort on;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment