<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EL link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText><span lang=EN-US>Hi!<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>I have setup one varnish server for multiple sites running on multiple backends. <o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>For example:<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>Domains: domainA.com, domainB.com running on backend: backendC<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>Domains: domain0.com, domain1.com running on backend: backend-10 Everything else goes to default backend DC<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>I also have the following setup<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>In sub vcl_recv {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>if (req.http.host ~ " domainA.com$") {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> unset req.http.cookie;<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> set req.backend = backendC;<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return (lookup);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>else if (req.http.host ~ "domainB.com$") {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> set req.backend = backendC;<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> if ( req.request == "POST" ) {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return(pass);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return (lookup);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>else if (req.http.host ~ "domain0.com$") {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> set req.backend = backend-10;<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> if ( req.request == "POST" ) {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return(pass);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return (lookup);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>else {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US># Use the default backend for all other requests set req.backend = default; return (lookup);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US> return (lookup);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>My problem is that I have POST requests for both domainB.com and domain0.com and each time I have to use set req.backend = if ( req.request == "POST" ) {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return(pass); in order to pass the request to the correct backend Is there a simpler way of handling post requests to different domains?<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>-------------------------------------------------------------------------------------------------------------<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>And a second question if I use<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>if (req.request != "GET" && req.request != "HEAD") {<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> // Not cacheable by default if NOT GET,HEAD<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> return(pass);<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>Then POST requests are passed to the default backend which, of course gives me an 404 error!<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText>Thanks in advance<o:p></o:p></p><p class=MsoNormal>Yiannis<o:p></o:p></p></div></body></html>