From 94966a49c167b17a61f040a6cbf5d5580dc55bb2 Mon Sep 17 00:00:00 2001 From: MoonTestUse1 Date: Tue, 24 Dec 2024 03:49:03 +0600 Subject: [PATCH] =?UTF-8?q?cha2524222fvdf=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/nginx/nginx.conf | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 8918c89..fc3d6d3 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -1,23 +1,30 @@ -user nginx; worker_processes auto; -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; +pid /run/nginx.pid; events { - worker_connections 1024; + worker_connections 768; } 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"'; + include /etc/nginx/mime.types; + default_type application/octet-stream; - access_log /var/log/nginx/access.log main; + sendfile on; + tcp_nopush on; + keepalive_timeout 65; - sendfile on; - keepalive_timeout 65; - include /etc/nginx/conf.d/*.conf; - } \ No newline at end of file + # Logging configuration + 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; + error_log /var/log/nginx/error.log; + + # Gzip compression + gzip on; + gzip_types text/plain text/css application/json application/javascript; + + # Include virtual host configs + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file