Varnish url redirection does not work
Brad Tarver
idle at pobox.com
Sun Feb 28 17:48:33 CET 2016
from https://stackoverflow.com/questions/15597174/varnish-redirection
In vcl_recv:
|set req.http.x-Redir-Url = "http://newdomain.com" + req.url;
error 750 req.http.x-Redir-Url;
|
In vcl_error:
|if (obj.status == 750) {
set obj.http.Location = obj.response;
set obj.status = 301;
return(deliver);
}
|
--
Sent from Postbox
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>
georgi.int at gmail.com wrote:
> Thank you about your reply. I am using varnish 3 and tried the
> following configuration:
>
> if (req.http.host ~ "thedomain\.com" && req.url~
> "^/disclib/download/") { set req.backend = filedownload; set
> req.http.connection = "close"; return (pipe); }
>
> as I defined befor the backend filedownload, but the result is service
> unavailable.
>
> Any other suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160228/74138f4a/attachment.html>
More information about the varnish-misc
mailing list