nginx -t can pass while nginx keeps serving the old config; how to deploy safely
A common deploy pattern runs nginx -t and then nginx -s reload, assuming a zero exit status means the new config is live. That assumption can be wrong. The -t check parses configuration without binding listening ports, so port conflicts only surface when the master process starts listening. The reload command is also asynchronous: it only signals the master and exits, and if the master fails to apply the new config, it silently keeps the old one. The article proposes versioned config directories, an atomic symlink swap, a confirmed reload, and a fallback for when nginx fails to start.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in