Skip to content

Varnish does not appear to be configured for a public folder web root (at least, with NGINX) #11692

@andrewhowdencom

Description

@andrewhowdencom

Preconditions

  1. Magento 2.4-develop
  2. Varnish 4/5/6

Steps to reproduce

  1. Set up a server according to the provided recommendations, with NGINX as the HTTP host and using the public folder
  2. Export varnish as shown by Magento
  3. Install varnish configuration

Expected result

  1. Server works

Actual result

  1. Varnish doesn't work (specifically, it returns a 503 and complains about upstream being down). Additionally, there are a bunch of messages in the NGINX error log about "404 /pub/health_check.php not found"

File is here: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/PageCache/etc/varnish5.vcl

As you can see, it has the pub hardcoded. I might suggest doing detection in the application, and adjusting the probe root accordingly.

Metadata

Metadata

Assignees

Labels

Component: CacheIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P4No current plan to fix. Fixing can be deferred as a logical part of more important work.Progress: doneReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S4Affects aesthetics, professional look and feel, “quality” or “usability”.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions