From a24fe5843f5fe3a1b7dfea6f742035c8f2d3b7cc Mon Sep 17 00:00:00 2001 From: Fascinated Date: Fri, 7 Jul 2023 23:46:36 +0100 Subject: [PATCH] add comments to nginx file --- docker/nginx.conf | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index 8b1e09d..3106cd4 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -3,35 +3,34 @@ events { } http { - access_log /dev/stdout; - error_log /dev/stdout; + access_log /dev/stdout; # Log access to stdout + error_log /dev/stdout; # Log errors to stdout + # Log format log_format main '[$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + '"$http_user_agent" "$http_x_forwarded_for"'; - include mime.types; - default_type application/octet-stream; + include mime.types; # Include the mime types file + default_type application/octet-stream; # Default type - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 15; - types_hash_max_size 4096; + sendfile on; # Send files directly from disk + keepalive_timeout 15; # Keep connections alive for 15 seconds + types_hash_max_size 4096; # Max number of mime types + + # TCP optimizations + tcp_nopush on; # Send headers in one packet + tcp_nodelay on; # Don't wait for packets to be full + server { - server_name _; - listen 80; + server_name _; # Listen on all hostnames + listen 80; # Listen on port 80 - root /var/www/html; - index index.html index.htm; - - # TCP optimizations - tcp_nopush on; - tcp_nodelay on; + root /var/www/html; # Serve files from /var/www/html + index index.html index.htm; # Serve index.html and index.htm by default # Gzip - sendfile on; gzip on; gzip_disable "msie6"; gzip_vary on; @@ -42,6 +41,7 @@ http { client_max_body_size 500M; # Will get replaced by the environment variable MAX_UPLOAD_SIZE + # Upload endpoint location /upload.php { try_files $uri =404; @@ -53,7 +53,8 @@ http { include fastcgi_params; } - location / { + # Serve your files + location / { expires 7d; open_file_cache max=1000 inactive=60s;