Skip to content

Commit 981c2f5

Browse files
vidarlmnocon
andauthored
Added instructions on how to combine varnish with basic-auth (#2526)
* Added instructions on how to combine varnish with basic-auth * fixup! Added instructions on how to combine varnish with basic-auth * Apply suggestions from code review Co-authored-by: Marek Nocoń <[email protected]> --------- Co-authored-by: Marek Nocoń <[email protected]>
1 parent 265117d commit 981c2f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,25 @@ ibexa:
142142
purge_servers: [http://my.varnish.server:8081]
143143
```
144144

145+
#### Varnish and Basic Auth
146+
147+
If the Varnish server is protected by Basic Auth, specify the Basic Auth credentials within the `purge_servers` setting using the format:
148+
149+
``` yaml
150+
http_cache:
151+
purge_servers: [http://myuser:[email protected]:8081]
152+
```
153+
154+
Varnish is enabled by default when using [[= product_name_cloud =]] and the `purge_servers` setting is set automatically.
155+
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:
156+
157+
```
158+
env:HTTPCACHE_USERNAME=myuser
159+
env:HTTPCACHE_PASSWORD=mypasswd
160+
```
161+
162+
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).
163+
145164
!!! note "Invalidating Varnish cache using tokens"
146165

147166
In setups where the Varnish server IP can change (for example, on [[= product_name_cloud =]]),

0 commit comments

Comments
 (0)