[ubuntu] nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

I use supervisor to run Nginx and Gunicorn side by side on a Docker container.

This was the configuration used for supervisor :

[supervisord]
nodaemon=true

[program:gunicorn]
command = /project/start.sh
user = www-data


[program:nginx]
command=/usr/sbin/nginx

The problem was how I launched Ngnix : by default it runs on the foreground. This makes supervise retry to run another instance of Nginx.

By adding -g 'daemon off;' to the command line, Nginx stayed in the foreground, supervisor stopped trying to run another instance.