Created
October 3, 2016 19:24
-
-
Save chazcheadle/525cd1925b915181b70b840b602e5427 to your computer and use it in GitHub Desktop.
Jenkins redirect in Varnish 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jenkins | |
# This will allow you to run Jenkins as <HOST>/jenkins. | |
# Varnish 4 declaration | |
vcl 4.0; | |
# Backend is using the default Jenkins port. | |
backend jenkins { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
} | |
sub vcl_recv { | |
if (req.http.host == "<HOST>" && req.url ~ "/jenkins(/.*)") { | |
set req.url = regsub(req.url, "/jenkins(/.*)" , "\1"); | |
set req.backend_hint = jenkins; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment