server {
  listen 80;
  server_name _;

  root /srv/files;

  # Directory listing defaults
  autoindex on;
  autoindex_exact_size off;
  autoindex_localtime on;
  charset utf-8;

  # Health check (always 200)
  location = /healthz {
    default_type text/plain;
    return 200 "ok\n";
  }

  # Serve files and allow dir listing at /
  location / {
    # If a file, serve it; if a directory, let autoindex handle it; else 404
    try_files $uri $uri/ /__not_found__;
  }

  # Internal 404 target to avoid probe failures at '/'
  location = /__not_found__ {
    return 404;
  }
}