Varnish in a docker container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
812 B

vcl 4.0;
import std;
import directors;
backend default {
.host = "dpedu.io";
.port = "80";
}
# Setup function
sub vcl_init {
new default_balancer = directors.round_robin();
default_balancer.add_backend(default);
}
sub vcl_recv {
# If X-Real-IP is unset, assume we are talking directly to the client
if (!req.http.X-Real-IP) {
set req.http.X-Real-IP = client.ip;
}
# Set backend to handle request
set req.backend_hint = default_balancer.backend();
set req.http.host = "dpedu.io";
# Disabled cookies for static assets
if (req.url ~ "(?i)\.(pdf|asc|dat|txt|doc|xls|ppt|tgz|csv|png|gif|jpeg|jpg|ico|swf|css|js)(\?.*)?$") {
unset req.http.Cookie;
# return cache for object
return (pass);
}
return (pass);
}