Error 404 not found for protected files (images)

Created on 26 August 2024, 5 months ago

Problem

The server returns a 404 error for files (images) managed by protected downloads, even if images are correctly uploaded in the protected directory: see the attached animation.

My settings:

Protected directory location:

MyProject
-- config
-- protected-files  <- Here
-- web
---- core
---- modules
---- [and so on with default Drupal dirs]




Protected directory path setting:

$settings['protected_download_file_path_protected'] = $app_root . '/../protected-files';




Default download method:




Caching




Upload Destination (field_images)



NGINX errors:

NGINX error when uploading the image:

nginx_1      | 2024/08/26 09:40:06 [error] 48#48: *209 open() "/var/www/html/web/protected-download/protected/66d10b80/9NmU8NGnltNWQaoucK7BMgJKlVah_Zz0vUXBQwRUOqE/styles/thumbnail/protected/2024-08/MY-IMAGE.jpg.webp" failed (2: No such file or directory), client: 192.168.144.6, server: default, request: "GET /protected-download/protected/66d10b80/9NmU8NGnltNWQaoucK7BMgJKlVah_Zz0vUXBQwRUOqE/styles/thumbnail/protected/2024-08/MY-IMAGE.jpg.webp?itok=KCsTCxxj HTTP/1.1", host: "dev.itabots.com", referrer: "http://dev.itabots.com/node/2/edit"




NGINX error when viewing the node:

nginx_1      | 2024/08/26 09:40:13 [error] 48#48: *209 open() "/var/www/html/web/protected-download/protected/66d10b80/f2BsT2bKtj8K7qyEZyrLvDt79mImN3rKL4IWy825-yA/2024-08/MY-IMAGE.jpg" failed (2: No such file or directory), client: 192.168.144.6, server: default, request: "GET /protected-download/protected/66d10b80/f2BsT2bKtj8K7qyEZyrLvDt79mImN3rKL4IWy825-yA/2024-08/MY-IMAGE.jpg HTTP/1.1", host: "dev.itabots.com", referrer: "http://dev.itabots.com/node/2"




Any suggestion to fix the problem is appreciated, thank you.

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy mxt Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024