From ff5ae3f01dec643c21be118a59e7a980dc9e9abf Mon Sep 17 00:00:00 2001 From: padreug Date: Sat, 12 Jul 2025 19:06:09 +0200 Subject: [PATCH] add nginx.conf example --- nginx.conf.example | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 nginx.conf.example diff --git a/nginx.conf.example b/nginx.conf.example new file mode 100644 index 0000000..e22b16e --- /dev/null +++ b/nginx.conf.example @@ -0,0 +1,45 @@ +# Main context +worker_processes auto; # Automatically determine worker processes based on CPU cores + +events { + worker_connections 1024; # Maximum connections per worker +} + +http { + default_type application/octet-stream; + # Trust the custom Docker network subnet + set_real_ip_from 0.0.0.0; + real_ip_header X-Forwarded-For; + real_ip_recursive on; + + server { + listen 8080; + server_name .; + + root /app; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.js$ { + types { application/javascript js; } + default_type application/javascript; + } + + # Serve CSS files with the correct MIME type + location ~* \.css$ { + types { text/css css; } + default_type text/css; + } + + # Serve image files + location ~* \.(png|jpe?g|webp|ico)$ { + expires 6M; # Optional: Cache static assets for 6 months + access_log off; + } + + } +} +