events {} http { server { listen 80; server_name _; root /usr/share/nginx/html; autoindex on; location / { autoindex on; try_files $uri $uri/ =404; # ✅ Limit methods correctly — inside location only limit_except GET HEAD { deny all; } } } }