server { listen 80; server_name localhost; location / { try_files $uri $uri/ =404; } error_page 404 = @empty404; location @empty404 { return 404; } }