Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created April 16, 2015 16:34
Show Gist options
  • Select an option

  • Save ryaan-anthony/6761ad405a3c8464d347 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/6761ad405a3c8464d347 to your computer and use it in GitHub Desktop.
/etc/nginx/nginx.conf
user nginx;
worker_processes 24;
worker_rlimit_nofile 150000;
error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
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"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 20s;
open_file_cache max=150000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
tcp_nopush on;
tcp_nodelay on;
keepalive_requests 100000;
reset_timedout_connection on;
client_body_timeout 20s;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
fastcgi_read_timeout 1000;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
client_max_body_size 100m;
map $http_x_forwarded_proto $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
gzip on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment