nginx -g 'daemon off;'

Category: Web Servers & Proxies

nginx -g 'daemon off;'

Run nginx in the foreground for containers or debugging

-g passes a global configuration directive, and daemon off; keeps nginx from forking into the background. This is the pattern used by the official nginx Docker image so the process stays in the foreground and receives signals. Quote the directive so the shell passes it as one argument.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.