mirror of
https://github.com/KevinMidboe/infra-map.git
synced 2025-10-29 17:40:28 +00:00
proxy through varnish
sets up varnish cache server with: - custom cache per content type - gzip - configure app & hass backends - varnish debug headers & X-Cache verbose cache header also updates docker-compose, varnish/Dockerfile & drone.
This commit is contained in:
40
varnish/vcl_deliver.vcl
Normal file
40
varnish/vcl_deliver.vcl
Normal file
@@ -0,0 +1,40 @@
|
||||
sub vcl_deliver {
|
||||
# Happens when we have all the pieces we need, and are about to send the
|
||||
# response to the client.
|
||||
|
||||
if (resp.status == 503) {
|
||||
set resp.http.failing-backend = "true";
|
||||
}
|
||||
|
||||
# Give some debug
|
||||
if (req.http.X-debug && req.esi_level == 0) {
|
||||
set resp.http.X-Backend = req.backend_hint;
|
||||
set resp.http.X-Backend-Url = req.url;
|
||||
} else {
|
||||
# not debug, strip some headers
|
||||
unset resp.http.X-Cache;
|
||||
unset resp.http.X-Backend;
|
||||
unset resp.http.x-upstream;
|
||||
unset resp.http.x-request-uri;
|
||||
unset resp.http.Via;
|
||||
unset resp.http.xkey;
|
||||
unset resp.http.x-goog-hash;
|
||||
unset resp.http.x-goog-generation;
|
||||
unset resp.http.X-GUploader-UploadID;
|
||||
unset resp.http.x-goog-storage-class;
|
||||
unset resp.http.x-goog-metageneration;
|
||||
unset resp.http.x-goog-stored-content-length;
|
||||
unset resp.http.x-goog-stored-content-encoding;
|
||||
unset resp.http.x-goog-meta-goog-reserved-file-mtime;
|
||||
unset resp.http.Server;
|
||||
unset resp.http.X-Apache-Host;
|
||||
unset resp.http.X-Varnish-Backend;
|
||||
unset resp.http.X-Varnish-Host;
|
||||
unset resp.http.X-Nginx-Host;
|
||||
unset resp.http.X-Upstream-Age;
|
||||
unset resp.http.X-Retries;
|
||||
unset resp.http.X-TTL;
|
||||
unset resp.http.X-Varnish;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user