I've got a third party hosted blog that I'm using varnish to cache. The rest of my site is hosted and served directly via apache, so I've d proxy pass…since the httpd proxypass points to the localhost:varnishport the browser shows localhost/blog:
ProxyPass /blog http://localhost:6081/blog
ProxyPassReverse /blog http://localhost:6081/blog
I tried using the following line in sub_vcl to try and rewrite the req.http.Host back:
set req.http.Host = regsub(req.http.Host, "localhost", "example\.com");
but I receive a 502 proxy error from apache (see below). should I be setting the header logic in another section of the VCL for what gets passed back to apache?
"The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /blog.
Reason: DNS lookup failure for: www.localhost"
example.com
the remote server, or your own server?localhost
in its URL? Is that what you're entering initially to browse the site, is it sent in a30x
response redirecting your browser, or is it due to following a link on the page that points tolocalhost
?