Mailing List Archive

Why POST methos is not work?
Hello, all.

I have setup vcl like below, and works well except POST method.
When I using POST Method like writing a message, the site is stops and
trying to connect the backend server continuously.
and I have restarted the varnishd but the result is same.

What's the problem and is there any problem at this config?

====================================================================

backend server1 {
set backend.host = "origin.abc.com";
set backend.port = "80";
}


sub vcl_recv {
if (req.http.Host == "www.abc.com")
{
set req.backend = server1;
set req.http.host = "origin.abc.com";

}
if (req.request == "POST") {
pipe;
}
if (req.request == "GET" && req.http.cookie) {
lookup;
}
if (req.http.Authenticate) {
pipe;
}

if (req.url ~ "\.cgi|php)$") {
pipe;
}

if (req.url ~ "\.(pdf|png|gif|jpg|mp3|svf)$") {
lookup;
}

}

_________________________________________________________________
MSN Messenger? ?? ????? ?? ??? ??? ????.
http://www.msn.co.kr/messenger
Why POST methos is not work? [ In reply to ]
"Monty Ree" <chulmin2 at hotmail.com> writes:
> I have setup vcl like below, and works well except POST method.
> When I using POST Method like writing a message, the site is stops
> and trying to connect the backend server continuously. and I have
> restarted the varnishd but the result is same.

Impossible to diagnose without logs.

> What's the problem and is there any problem at this config?

Yes:

1) Do not ever use an existing domain name (abc.com in this case) in
documentation or sample code. The example.com domain has been
reserved for this purpose.

2) You've got the logic backwards. If your site uses cookies, then
in most cases control will reach the "lookup" in the (req.request
== "GET" && req.http.cookie) clause and the rest of vcl_recv()
will have no effect.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no