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

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

Open
zhangtaihao opened this issue Aug 27, 2021 · 0 comments
Open

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

zhangtaihao opened this issue Aug 27, 2021 · 0 comments

Comments

@zhangtaihao
Copy link

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant