Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3FS module + Image style support #28

Open
Coufu opened this issue Jun 26, 2022 · 0 comments
Open

S3FS module + Image style support #28

Coufu opened this issue Jun 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Coufu
Copy link

Coufu commented Jun 26, 2022

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;
  }
@Coufu Coufu added the bug Something isn't working label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant