From 6a5ca97b6529e53a22271572bf5bf3b603460bcb Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 30 May 2023 14:32:20 +0200 Subject: [PATCH] Better Nginx config. --- docker/nginx.conf | 17 +++++++++-------- docker/server.conf | 10 ---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index 86057c3..c317f84 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -1,16 +1,15 @@ - user nginx; worker_processes auto; +worker_rlimit_nofile 100000; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; - events { - worker_connections 1024; + worker_connections 4096; + multi_accept on; } - http { include /etc/nginx/mime.types; default_type application/octet-stream; @@ -26,10 +25,12 @@ http { POST $binary_remote_addr; } - limit_req_zone $binary_remote_addr zone=one_per_second:20m rate=1r/s; - limit_req_zone $binary_remote_addr zone=one_per_minute:20m rate=1r/m; - - keepalive_timeout 65; + gzip on; + gzip_vary on; + gzip_comp_level 6; + gzip_min_length 1000; + gzip_proxied any; + gzip_types text/plain application/x-javascript application/javascript text/xml text/css application/xml application/json; include /etc/nginx/conf.d/*.conf; } \ No newline at end of file diff --git a/docker/server.conf b/docker/server.conf index 0faad89..41278d6 100644 --- a/docker/server.conf +++ b/docker/server.conf @@ -12,16 +12,6 @@ server { real_ip_recursive on; set_real_ip_from 0.0.0.0/0; - sendfile on; - sendfile_max_chunk 1m; - tcp_nopush on; - tcp_nodelay on; - gzip on; - gzip_comp_level 4; - gzip_min_length 1000; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain application/x-javascript application/javascript text/xml text/css application/xml application/json; - location / { }