Created
November 28, 2013 17:14
-
-
Save pixind/7695257 to your computer and use it in GitHub Desktop.
nginx base config for 2 cores
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat /dev/null > /etc/nginx/nginx.conf | |
cat > /etc/nginx/nginx.conf << EOL | |
user www-data; | |
worker_processes 2; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 500; | |
use epoll; | |
multi_accept on; | |
} | |
http { | |
keepalive_timeout 30; | |
keepalive_requests 1500; | |
# experimental cache stuff... | |
open_file_cache max=200000 inactive=20s; | |
open_file_cache_valid 30s; | |
open_file_cache_min_uses 2; | |
open_file_cache_errors on; | |
# end experimental stuff... | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
types_hash_max_size 2048; | |
server_names_hash_bucket_size 256; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} | |
EOL | |
service nginx restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment