Closed zhangchunsheng closed 3 months ago
@zhangchunsheng
The master process of Nginx always runs as the root user; however, its child processes will run under the user and group defined by the environment variables $APP_USER
and $APP_GROUP
(by default, APP_USER=www-data
and APP_GROUP=www-data
). To change the user and group, please modify these two environment variables when you start the container.
More details: https://github.com/shinsenter/php/blob/main/README.md#customizing-container-user-and-group-in-docker
The nginx user is www-data not root.
www-data 424 412 0 13:10 ? 00:00:00 nginx: worker process www-data 425 412 0 13:10 ? 00:00:00 nginx: worker process