worker_processes auto;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    sendfile on;
    
    server {
        listen 80;
        server_name cumtanks.snowsune.net;

        # Docker container path
        root /usr/share/nginx/html;
        index index.html;

        # Low TTL for data.json
        location /data.json {
            add_header Cache-Control "max-age=5, must-revalidate";
            try_files $uri =404;
        }

        # Normal caching for other static files
        location / {
            expires 1h;
            add_header Cache-Control "public, no-transform";
            try_files $uri $uri/ =404;
        }

        # Ignore favicon requests
        location /favicon.ico {
            log_not_found off;
            access_log off;
        }

        # Optional: Serve index on 404
        error_page 404 /index.html;
    }
} 