Skip to content

Commit ef29570

Browse files
committed
fix: Add nginx temp directory permissions for file uploads
Files larger than client_body_buffer_size (128k) require nginx to buffer to /var/lib/nginx/tmp/client_body/. Without proper permissions, uploads of larger files fail with 'Permission denied' errors. Fixes 500 error when uploading PDFs larger than ~128KB.
1 parent 054703f commit ef29570

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cloudformation/scenarios/localgov-drupal/docker/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ echo "AWS Region: ${AWS_REGION:-us-east-1}"
1212
mkdir -p /var/log/nginx /var/log/supervisor
1313
touch /var/log/nginx/access.log /var/log/nginx/error.log
1414

15+
# Ensure nginx temp directories exist with correct permissions
16+
# Required for buffering file uploads larger than client_body_buffer_size
17+
mkdir -p /var/lib/nginx/tmp/client_body
18+
chown -R www-data:www-data /var/lib/nginx
19+
chmod -R 755 /var/lib/nginx
20+
1521
# Set correct permissions on Drupal files
1622
chown -R www-data:www-data /var/www/drupal/web/sites/default/files || true
1723
chmod 755 /var/www/drupal/web/sites/default/files || true

0 commit comments

Comments
 (0)