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

Varnish: Adjust preset.vcl include order. #7

Merged

Conversation

davidwhthomas
Copy link

Firstly, thanks for the excellent work on this set of Docker images and related configuration! Great stuff.

Anyway, I'd like to submit a patch to fix an issue that happens when using Varnish with Drupal private files (system/files)

Because preset.vcl is included after static.vcl in the default template, then the vcl_recv will strip the cookies from the private file request, e.g https://example.com/system/files/sample.csv

sub vcl_recv {
    if (req.url ~ "(?i)\.({{ $static_files }})(\?.*)?$") {
        unset req.http.Cookie;

The cookies are required to authenticate the private file download request for Drupal.

This patch simply adjusts the ordering, to allow the preset.vcl to override static.vcl in vcl_recv for the system/files path, to return the pass there

Please check sometime and apply if suitable, thanks again.

@csandanov csandanov merged commit cee55bd into wodby:master Nov 26, 2018
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

Successfully merging this pull request may close these issues.

2 participants