Skip to content

Commit 4c5e9d6

Browse files
authored
Fix nginx permission error for log directory access (#88)
The nginx service was failing to start due to permission denied errors when trying to access /var/lib/nginx/logs/error.log. This directory is a symlink to /var/log/nginx which was owned by the nginx user instead of the nbxyz user that runs the service. Added proper ownership setup for /var/log/nginx directory to ensure nginx can write logs when running as the nbxyz user.
1 parent ca7a339 commit 4c5e9d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

root/init.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mkdir -p \
2929
/config/nginx/site-confs \
3030
/config/log/nginx \
3131
/run \
32+
/var/lib/nginx/logs \
3233
/var/lib/nginx/tmp/client_body \
3334
/var/tmp/nginx \
3435
/var/log
@@ -45,6 +46,7 @@ chown -R nbxyz:nbxyz /var/lib/nginx
4546
chown -R nbxyz:nbxyz /config/log/nginx
4647
chown -R nbxyz:nbxyz /run
4748
chown -R nbxyz:nbxyz /var/tmp/nginx
49+
chown -R nbxyz:nbxyz /var/log/nginx
4850

4951
# create local logs dir
5052
mkdir -p \

0 commit comments

Comments
 (0)