When I open in browser http://localhost:1567/sites/default/files/styles/thumbnail/public/2017-10/478069720_1384178114_4.jpg, I see 404.

The "original" images are uploaded successfully, and the website works without any problems. Only the image styles are not generated.

My environment:

I debugged: there is no request to index.php. When I remove the SetHandler Drupal_Security_Do_Not_Remove ... in /sites/default/files/.htaccess, everything works. But I do not want to remove these security headers.

FYI: in Docker for Windows everything is executed as root and default permissions are 755. See Official docker for windows documentation about file permissions.

Current workaround

Custom Dockerfile with the next lines at the end:

# Docker works with mounted directories as user with uid 1000.
# A www-data should be 1000 to prevent problems with permissions in /sites/default/files directory.
RUN usermod -u 1000 www-data && adduser dev --disabled-password --gecos "" && usermod -aG www-data dev
  • As you are inside your local dev environment I'ld say you don't have to be too concerned about security.
    – leymannx
    Feb 6, 2018 at 18:37


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.