Skip to content

Non-image binary files don't work with Stage File Proxy #248

@zhangtaihao

Description

@zhangtaihao

The 203-expires.conf nginx helper takes over URLs matching non-image files to set an expiration header:

location ~* ^/sites/default/(files/(?!private/)).+\.(pdf|doc|docx|txt|xls|xlsx|csv|ppt|pptx|pps|ppsx|odt|ods|odp|mp3|mov|mp4|m4a|m4v|mpeg|avi|ogg|oga|ogv|weba|webp|webm)$ {
    ...
}

Since there is no try_files $uri @drupal, Stage File Proxy doesn't work for these URLs. This results in the non-production sites in the GovCMS SaaS returning OpenResty 404 pages for these URLs, making it difficult to test non-image files in staging.

Is this by design, or is there another mechanism to support Stage File Proxy? Would there be any reason not to use the NGINX_DEFAULT_EXPIRES variable instead of this helper?

FYI In my local dev environment I've worked around the issue by adding:

/etc/nginx/conf.d/drupal/location_expires_append_drupal.conf:

try_files $uri @drupal;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions