events { worker_connections 1024; # Maximum simultaneous connections per worker } http { include mime.types; default_type application/octet-stream; server { listen 80; server_name localhost; # Or your domain name location / { root /var/www/html; # Directory where your files are located index index.html index.htm; } # Custom error page for 404 error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } } }