Skip to content

Commit 051689a

Browse files
committed
fix: run nginx workers as www-data instead of root
The actual worker user is controlled by the 'user' directive in nginx.conf, not the NGINX_DAEMON_USER env var (which gets overwritten by Bitnami's nginx-env.sh anyway). Changed from 'root root' to 'www-data www-data' so nginx workers can read files created by PHP. Reverts the env var change (irrelevant) and fixes the real source. Fixes: https://github.com/lando/drupal/issues/124
1 parent 6704f30 commit 051689a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

builders/nginx.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ module.exports = {
9494
command: `/launch.sh ${vhosts} ${server} ${params}`,
9595
environment: {
9696
NGINX_HTTP_PORT_NUMBER: '80',
97-
NGINX_DAEMON_USER: 'www-data',
98-
NGINX_DAEMON_GROUP: 'www-data',
97+
NGINX_DAEMON_USER: 'root',
98+
NGINX_DAEMON_GROUP: 'root',
9999
LANDO_NEEDS_EXEC: 'DOEEET',
100100
},
101101
ports: ['80'],

config/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Based on https://www.nginx.com/resources/wiki/start/topics/examples/full/#nginx-conf
2-
user root root; ## Default: nobody
2+
user www-data www-data; ## Default: nobody
33

44
worker_processes auto;
55
error_log "/opt/bitnami/nginx/logs/error.log";

0 commit comments

Comments
 (0)