{"action":"closed","issue":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/121","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/121/comments","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/121/events","html_url":"https://github.com/FriendsOfSymfony/FOSHttpCache/issues/121","id":40421411,"number":121,"title":"Varnish Multi Servers","user":{"login":"thuynh","id":28160,"avatar_url":"https://avatars.githubusercontent.com/u/28160?v=3","gravatar_id":"","url":"https://api.github.com/users/thuynh","html_url":"https://github.com/thuynh","followers_url":"https://api.github.com/users/thuynh/followers","following_url":"https://api.github.com/users/thuynh/following{/other_user}","gists_url":"https://api.github.com/users/thuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/thuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thuynh/subscriptions","organizations_url":"https://api.github.com/users/thuynh/orgs","repos_url":"https://api.github.com/users/thuynh/repos","events_url":"https://api.github.com/users/thuynh/events{/privacy}","received_events_url":"https://api.github.com/users/thuynh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-08-16T21:55:24Z","updated_at":"2015-03-13T11:08:01Z","closed_at":"2015-03-13T11:08:01Z","body":"When multiple servers are defined, upon sending the requests, the actual server ip addresses got lost. \r\n\r\nFOS\\HttpCache\\ProxyClient\\AbstractProxyClient.php\r\n\r\n```\r\nprivate function sendRequests(array $requests) \r\n{\r\n        $allRequests = array();\r\n\r\n        foreach ($requests as $request) {\r\n            foreach ($this->servers as $server) {\r\n                $proxyRequest = $this->client->createRequest(\r\n                    $request->getMethod(),\r\n                    $server . $request->getResource(),\r\n                    $request->getHeaders()\r\n                );\r\n\r\n                $allRequests[] = $proxyRequest;\r\n            }\r\n        }\r\n\r\n        try {\r\n            $this->client->send($allRequests);\r\n        } catch (GuzzleExceptionCollection $e) {\r\n            $this->handleException($e);\r\n        }\r\n    }\r\n```\r\n\r\n**This is what the raw header looks like:**\r\n\r\nPURGE /playlist/featured HTTP/1.1\r\nHost: premium.domain.local\r\nX-Forwarded-Domain: premium.domain.local\r\nUser-Agent: Guzzle/3.7.0 curl/7.28.1 PHP/5.4.10\r\n\r\nPURGE /playlist/featured HTTP/1.1\r\nHost: premium.domain.local\r\nX-Forwarded-Domain: premium.domain.local\r\nUser-Agent: Guzzle/3.7.0 curl/7.28.1 PHP/5.4.10\r\n\r\n**I am able to get around this for now by creating a custom Varnish client that has almost all the methods required but adding just one tiny thing. It would have been much simpler if the method was protected.**\r\n\r\n```\r\nprivate function sendRequests(array $requests)\r\n{\r\n\t\t$allRequests = array();\r\n\r\n\t\tforeach ($requests as $request) {\r\n\t\t\tforeach ($this->servers as $server) {\r\n\t\t\t\t$parts = parse_url($server);\r\n\t\t\t\t$proxyRequest = $this->client->createRequest(\r\n\t\t\t\t\t$request->getMethod(),\r\n\t\t\t\t\t$server . $request->getResource(),\r\n\t\t\t\t\t$request->getHeaders()\r\n\t\t\t\t);\r\n\t\t\t\t$proxyRequest->setHeader('Host', $parts['host']);\r\n\t\t\t\t$allRequests[] = $proxyRequest;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t$this->client->send($allRequests);\r\n\t\t} catch (GuzzleExceptionCollection $e) {\r\n\t\t\t$this->handleException($e);\r\n\t\t}\r\n}\r\n```\r\n\r\nPURGE /playlist/featured HTTP/1.1\r\nX-Forwarded-Domain: premium.domain.local\r\nUser-Agent: Guzzle/3.7.0 curl/7.28.1 PHP/5.4.10\r\nHost: 192.168.1.12\r\n\r\nPURGE /playlist/featured HTTP/1.1\r\nX-Forwarded-Domain: premium.domain.local\r\nUser-Agent: Guzzle/3.7.0 curl/7.28.1 PHP/5.4.10\r\nHost: 192.168.1.13"}}