Skip to content

[container] Nginx not receiving signals due to background process handling #23

@timo-reymann

Description

@timo-reymann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions