In the current Docker entrypoint, Nginx is started in the background, and the main process (statsig_forward_proxy) is executed afterward:
nginx > /dev/null 2>&1 &
exec statsig_forward_proxy "$@"
This setup prevents Nginx from receiving container stop signals (SIGTERM, SIGINT) directly, which can cause:
- Graceful shutdown not happening.
- Orphaned Nginx processes.
- Containers taking longer to stop.
Expected behavior:
- Nginx should receive signals from Docker/Kubernetes directly.
- Both Nginx and the proxy should shut down cleanly when the container stops.
Possible solutions:
- Use a process manager (e.g.,
supervisord, s6, multirun) to run both processes.
- Or, run Nginx as the main process and have the proxy in a separate container.
- Or, have the entrypoint handle signals and forward them to Nginx.