add nginx.conf example

This commit is contained in:
padreug 2025-07-12 19:06:09 +02:00
parent 0c90af01b1
commit ff5ae3f01d

45
nginx.conf.example Normal file
View file

@ -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 <domain>.<com>;
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;
}
}
}