Blog
Practical writing on AI engineering, infrastructure, backend systems, and production lessons learned.
Category
154 posts found
Archive
Browse the archive page by page for a faster, cleaner reading experience.
147 posts total
Nginx File Upload: Incremental Processing, Buffering, and client_max_body_size
•2 min read•Web DevelopmentNginx reads request bodies incrementally in chunks. If the body exceeds client_max_body_size at any point, nginx immediately returns 413 and discards remaining data without waiting for the full upload. For large file uploads, nginx buffers to disk (client_body_temp_path) before passing to upstream — adding latency. Direct S3 uploads via presigned URLs bypass nginx entirely.
nginxfile-uploadNginx Errors: Conflicting server_name, 413, and upstream Errors
•2 min read•Web DevelopmentCommon nginx configuration errors: conflicting server_name on the same port (duplicate default_server or duplicate hostname), 413 Request Entity Too Large from client_max_body_size, 502 Bad Gateway from upstream connection failure, and 499 client closed request from slow backends. nginx -t validates config without restarting.
nginxhttpdebuggingNginx Server Block Selection: default_server, server_name, and location Matching
•1 min read•Web DevelopmentNginx selects a server block by matching the Host header against server_name directives. If no match, it uses the default_server (or the first block if none is declared). The _ server_name is a conventional catch-all — not a wildcard. location blocks have a precedence order: = (exact) > ^~ (prefix priority) > ~ (regex) > plain prefix.
nginxconfiguration