lando / lando/drupal

S3FS module + Image style support

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
16
Forks
19
PR merge metrics
No merged PRs in 30d

Description

If you use the drupal/s3fs module (https://www.drupal.org/project/s3fs) with image styles, it changes all the image styles paths to start with /s3/files/styles/....

The current vhost default.conf file doesn't allow for generating image styles using that path, making all the image styles 404

Current (doesn't support S3FS module + image styles)

  # Fighting with Styles? This little gem is amazing.
  # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
  location ~ ^(/[a-z\-]+)?/sites/.*/files/styles/ { # For Drupal >= 7
      try_files $uri @rewrite;
  }

After much debugging for finding the root cause, I did the following and it works now. I don't know if it's the best way, but just thought I'd share if someone would want to contribute and commit into the recipe.

Fixed (at least for me)

  # Fighting with Styles? This little gem is amazing.
  # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
  location ~ '^(/[a-z\-]+)?/sites/.*/files/styles/|^/s3/files/styles/' { # For Drupal >= 7
      try_files $uri @rewrite;
  }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the vhost default.conf file and compare the existing Drupal image-style location rule with the reported S3FS path. Verify image-style URLs beginning with /s3/files/styles/ no longer return 404 while existing Drupal image styles continue to work; the issue's supplied configuration shows the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
drupal, nginx
Domain
backend, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.