worker_processes auto; worker_rlimit_nofile 100000; events { worker_connections 2048; # Increased to handle more connections use epoll; # Use epoll for Linux systems for better performance } http { include /etc/nginx/mime.types; default_type application/octet-stream; charset utf-8; # Ensure UTF-8 encoding is used by default sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; # Adjusted keepalive timeout for better resource management types_hash_max_size 2048; # Increase the hash bucket size for better performance gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; gzip_proxied any; gzip_comp_level 6; gzip_vary on; gzip_min_length 256; gzip_buffers 16 8k; gzip_http_version 1.1; proxy_cache_path /tmp/cache levels=1:2 keys_zone=static_cache:100m inactive=24h max_size=1g; proxy_cache_key "$scheme$request_method$host$request_uri"; client_body_buffer_size 128k; client_max_body_size 10m; client_header_buffer_size 1k; large_client_header_buffers 4 16k; server { listen 8111; server_name localhost; root /home/me/aesthetic-computer/system/public; index index.html index.htm; location / { try_files $uri $uri/ =404; etag on; if_modified_since exact; #proxy_cache static_cache; #proxy_cache_valid 200 1d; #add_header X-Proxy-Cache $upstream_cache_status; # Cache bypass and revalidation # proxy_cache_bypass $http_cache_control; # proxy_no_cache $http_cache_control; #proxy_cache_revalidate on; # Ensure cache invalidation on file changes #open_file_cache max=1000 inactive=20s; #open_file_cache_valid 30s; #open_file_cache_min_uses 2; #open_file_cache_errors on; } access_log off; error_log /var/log/nginx/error.log warn; # Logging errors for better troubleshooting } }