server {
    listen 80;
    server_name _;
    root /usr/share/nginx/html;

    # CORS pra Evolution API poder puxar
    add_header Access-Control-Allow-Origin "*" always;

    # Serve arquivos estaticos com auto-index
    location / {
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
        try_files $uri $uri/ =404;
    }

    # Cache agressivo pra imagens
    location ~* \.(jpg|jpeg|png|gif|webp|svg)$ {
        expires 7d;
        add_header Cache-Control "public, immutable";
        add_header Access-Control-Allow-Origin "*" always;
    }
}
