Update Documentation for NGINX Configuration

Created on 30 April 2018, over 6 years ago
Updated 19 December 2023, about 1 year ago

Sharing this piece of code for updating the documentation around S3FS and NGINX, it may save time and headache. This code snippet is for Image Style Rewrite for S3FS.

  location ~* ^/s3/files/styles/(.*)\.(png|svg|jpg|jpeg|gif|ico)$ {
    rewrite ^(.*)$ /index.php?q=$1;
  }
📌 Task
Status

Closed: duplicate

Version

3.0

Component

Documentation

Created by

🇺🇸United States cjgratacos

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy trickfun

    I think that this task is not a duplicate.
    if i use S3 nginx module configuration

    location ~ ^/s3/files/styles/ {
                try_files $uri @rewrite;
        }
    

    I get this error
    could not find named location "@rewrite",

    If i use above configuration

        location ~* ^/s3/files/styles/(.*)\.(png|svg|jpg|jpeg|gif|ico)$ {
        rewrite ^(.*)$ /index.php?q=$1;
    }
    

    no image is generated.

    if i use previous configuration with WEBP image style conversion i get the right image.

    So. can you provide a better documentation for Nginx?
    Thank you

Production build 0.71.5 2024