-
Notifications
You must be signed in to change notification settings - Fork 81
Added instructions on how to combine varnish with basic-auth #2526
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,25 @@ | |
| purge_servers: [http://my.varnish.server:8081] | ||
| ``` | ||
|
|
||
| #### Varnish and Basic Auth | ||
|
|
||
| If the Varnish server is protected by Basic Auth, specify the Basic Auth credentials within the `purge_servers` setting using the format: | ||
|
|
||
| ``` yaml | ||
| http_cache: | ||
| purge_servers: [http://myuser:[email protected]:8081] | ||
| ``` | ||
|
|
||
| Varnish is enabled by default when using [[= product_name_cloud =]] and the `purge_servers` setting is set automatically. | ||
|
Check warning on line 154 in docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md
|
||
| To enable Basic Auth on [[= product_name_cloud =]] when using Varnish, specify the credentials using the following environment variables to make sure that Varnish is reachable: | ||
|
|
||
| ``` | ||
|
Check failure on line 157 in docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md
|
||
| env:HTTPCACHE_USERNAME=myuser | ||
| env:HTTPCACHE_PASSWORD=mypasswd | ||
| ``` | ||
|
|
||
| If you want to use Basic Auth with Fastly on [[= product_name_cloud =]], please see [Enable basic-auth on Fastly](fastly.md#enable-basic-auth-on-fastly). | ||
|
|
||
| !!! note "Invalidating Varnish cache using tokens" | ||
|
|
||
| In setups where the Varnish server IP can change (for example, on [[= product_name_cloud =]]), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we suggest using HTTPS by default, for everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can do that. But open source version of Varnish do not support HTTPS termiation, so I think it makes more sense to always use HTTP for varnish purge servers in or docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! My mind always goes to "HTTPS links everywhere", but it makes sense to make an exception when it's expected to see HTTP.