https://github.com/ipunkt/docker-varnish-stale-config
stale-on-revalidate and stale-on-error config to use in a varnish container via volumes_from
https://github.com/ipunkt/docker-varnish-stale-config
Last synced: 6 months ago
JSON representation
stale-on-revalidate and stale-on-error config to use in a varnish container via volumes_from
- Host: GitHub
- URL: https://github.com/ipunkt/docker-varnish-stale-config
- Owner: ipunkt
- License: mit
- Created: 2016-11-29T10:01:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-20T07:51:48.000Z (almost 8 years ago)
- Last Synced: 2025-02-07T05:27:39.502Z (over 1 year ago)
- Language: Dockerfile
- Size: 49.8 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-varnish-stale-config
stale-on-revalidate and stale-on-error config template for confd to use with [rancher-tools](https://github.com/rawmind0/rancher-tools)
# Config
The configuration currently uses a round-robin director to add all backends.
The backends are generated from the services links. However in rancher 1.2.0-pre3 there is a bug in
rancher/confd giving `STACK/SERVICE` as key and confd only passes on the `STACK` part. Thus the config is generated
for all services matching the links `STACK` and:
- BACKEND\_PREFIX: Name to match
- BACKEND\_DIVIDER: only up until this character is matched
- NOBOTS: if this is set to `true` then the bot useragent -> pass through(pipe) mode instead of cache
- VARY\_AUTH: If this is set to `true` then caching will take place despite an authorization header being sent. Responses
will vary based on the authorization header.
This is ment for staging environments with basic auth protection.
- IGNORE\_COOKIES: If this is set to `true` then caching will take place despite cookies. Responses are NOT varied by cookie
- SIMPLE\_BACKEND: If this is set to `true` then varnish will simply use the
hostname `backend` as its backend.
- IGNORE\_QUERYSTRING\_EXCLUDE: List of regexes separated by `~`. If any of them matches then the url will not ignore querystrings
- HEALTHCHECK: if set to `true` then a probe will be set for all backends checking `/` for 2xx responses
- HEALTHCHECK\_URL: replace `/` as the url in the healthcheck
- EXPECTED\_RESPONSE: Expect this response instead of 200 for healthchecks
Ex. BACKEND\_PREFIX `abc`, BACKEND_DIVIDER `-`:
- `abc-v1` would match `abc` = `abc` and create a backend for the service
- `abcd-v1` would match `abcd` != `abc` and discard the service
# Important
You must make `/opt/tools` a volume in your container for this image to work.
The actual content is unpacked into `/opt/tools` when the container is run
Because confd is run in the rancher-tools container and not in this sidekick container all options MUST be set in the
rancher-tools container
# Created configs
- VARNISH_CONFIG: `/opt/varnish/etc/default.vcl` - 1 year grace