From 80b5adf3f455922d807b7e9b6ed1302de1bb9284 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Thu, 18 Dec 2025 10:52:23 -0700 Subject: [PATCH] Fix nginx parent directory permissions - chmod 755 on /var/lib/nginx to allow www-data to traverse - Parent directory was 750 (drwxr-x---) owned by nginx:nginx - www-data couldn't access tmp subdirectory despite owning it - This fixes the Permission denied error on PDF uploads --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b66ee4e..29a69dad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,9 +62,10 @@ RUN mkdir -p /var/lib/nginx/tmp/client_body \ /var/lib/nginx/tmp/uwsgi \ /var/lib/nginx/tmp/scgi -# Set permissions -RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp -RUN chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp +# Set permissions - fix parent directory first, then subdirectories +RUN chmod 755 /var/lib/nginx && \ + chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp && \ + chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp # Copy nginx configuration COPY docker/nginx.conf /etc/nginx/nginx.conf