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

Host header altered in default.vcl #75

Open
lpaolini opened this issue Aug 29, 2024 · 1 comment
Open

Host header altered in default.vcl #75

lpaolini opened this issue Aug 29, 2024 · 1 comment

Comments

@lpaolini
Copy link

I understand Varnish is supposed to be transparent, so why is the original Host request header replaced with backend's host:port in default configuration (default.vcl, lines 37-42)?

@gquintard
Copy link
Collaborator

Hi @lpaolini !

I understand Varnish is supposed to be transparent

What gave you that idea? :-)

TL;DR: it caters to the most common case for beginners.

As the default.vcl is really an entry-level solution so that new users don't have to write code to plug into their origin. From experience, users tend to discover the solution locally and just visit http://127.0.0.1, so aligning the host header with the host name prevents a bunch of issues where the origin returns a 400 or 404.

That being said, there's a case to be made about allowing a different host header with an environment variable, and I'm very happy to review PRs coming my way.

As always, I'm open to counter-arguments, I might very well have missed a factor in this discussion

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

2 participants