Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define backends
- backend backend01 {
- .host = "127.0.0.1";
- .port = "8080";
- .probe = {
- .request =
- "HEAD /ping HTTP/1.1"
- "Host: www.oursite.com"
- "Connection: close";
- .timeout = 2s;
- .interval = 1s;
- .window = 1;
- .threshold = 1;
- }
- }
- // Director setup
- sub vcl_init {
- new score = directors.round_robin();
- score.add_backend(backend01);
- }
- // Access control (mainly for PURGE commands)
- acl purge {
- "localhost";
- "127.0.0.1";
- "::1";
- }
- acl intern {
- "x.x.x.x";
- }
- // Bad IP adresses we want to keep out - see hash.vcl
- acl badguys {
- "11.22.33.44";
- }
- // Sub-routine for setting the backend director and the X-Forwarded-For HTTP
- // header. Called by vcl_recv.
- sub set_director_and_forwardedfor {
- set req.backend_hint = score.backend();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement