Last active
May 8, 2018 07:37
-
-
Save benhartwich/91f3d1e6ed5890897d10 to your computer and use it in GitHub Desktop.
nginx.conf
This file contains hidden or 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
user www-data; | |
worker_processes auto; | |
thread_pool default threads=32 max_queue=65536; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; # Abfrage mittels ulimit -n | |
multi_accept on; | |
use epoll; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 20; | |
reset_timedout_connection on; | |
types_hash_max_size 2048; | |
server_tokens off; | |
server_names_hash_bucket_size 128; | |
# server_name_in_redirect off; | |
limit_req_zone $binary_remote_addr zone=one:10m rate=50r/m; | |
aio threads=default; | |
# SSL Settings | |
ssl_session_cache shared:SSL:50m; | |
ssl_session_timeout 5m; | |
ssl_session_tickets off; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; | |
ssl_dhparam ssl/dhparam.pem; | |
# Logging Settings | |
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 combined; | |
error_log /var/log/nginx/error.log; | |
# Brotli | |
brotli on; | |
brotli_static on; | |
brotli_min_length 1000; | |
brotli_buffers 32 8k; | |
brotli_comp_level 5; | |
brotli_types text/plain text/css text/xml application/javascript application/x-javascript application/xml application/xml+rss application/ecmascript application/json image/svg+xml; | |
#Gzip | |
gzip on; | |
gzip_comp_level 6; | |
gzip_min_length 1000; | |
gzip_proxied any; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
gzip_buffers 16 8k; | |
gzip_vary on; | |
gzip_http_version 1.1; | |
gzip_disable "MSIE [1-6]\."; | |
#Vhost Optimizations | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
client_max_body_size 8m; | |
index index.html index.php; | |
client_body_buffer_size 128k; | |
client_header_buffer_size 32k; | |
large_client_header_buffers 4 32k; | |
client_body_timeout 12; | |
client_header_timeout 12; | |
send_timeout 10; | |
server_names_hash_max_size 850; | |
open_file_cache max=2000 inactive=20s; | |
open_file_cache_valid 30s; | |
open_file_cache_min_uses 2; | |
open_file_cache_errors on; | |
fastcgi_buffers 256 4k; | |
fastcgi_buffer_size 32k; | |
proxy_buffering off; | |
proxy_buffer_size 128k; | |
proxy_buffers 4 256k; | |
proxy_busy_buffers_size 256k; | |
map $http_accept $webp_ext { | |
default ""; | |
"~*webp" ".webp"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment