Could it be related to Host header mismatch? In your direct example it is localhost, but when routed via squid it will become couchdb. You can add forceddomain=localhost parameter in your cache_peer directive in order to fix it. Hope this helps! Best, Niki P.S. I assume you run both Squid and CouchDB on one and the same (virtual/physical) machine. If not, then "cache_peer localhost" is a ver wrong statement :-) On Fri, Jan 31, 2014 at 1:29 AM, Boaz Citrin <bcitrin@xxxxxxxxx> wrote: > Hello, > > I request a page directly from my server and all works fine. > Same request through Squid as a reverse proxy I get a timeout. > Squid version is 2.7.STABLE8 running on Windows 7 64-bit. > > The request is pretty standard: > >> GET /_fti/local/viz_data_hub/_design/lucene/search?q=%28directory:%22/directory/id/urn:uuid:63e5cd29-a2c0-43b9-a8fe-df4e85579c9b%22%29&skip=0&limit=50&include_docs=true HTTP/1.1 >> User-Agent: curl/7.26.0 >> Host: localhost:5984 >> Accept: */* > > > My server, when requested directly, returns the following headers: > > < HTTP/1.1 200 OK > < Vary: Accept, Accept-Encoding, User-Agent > < Transfer-Encoding: chunked > < Server: Jetty(8.1.14.v20131031), CouchDB/1.2.1 (Erlang OTP/R14B04) > < ETag: d2efc8de394f > < Date: Thu, 30 Jan 2014 22:59:28 GMT > < Content-Type: text/plain;charset=UTF-8 > < Cache-Control: must-revalidate > > > This is the relevant part from Squid config, all the rest is the default: > > http_port 5986 accel defaultsite=couchdb > cache_peer localhost parent 5984 0 no-query originserver name=couchdb_server > acl couchdb_access dstdomain couchdb > http_access allow couchdb_access > cache_peer_access couchdb_server allow couchdb_access > cache_peer_access couchdb_server deny all > > > And this is the response from Squid: > > < HTTP/1.0 504 Gateway Time-out > < Server: squid/2.7.STABLE8 > < Date: Thu, 30 Jan 2014 23:15:25 GMT > < Content-Type: text/html > < Content-Length: 1223 > < X-Squid-Error: ERR_READ_TIMEOUT 0 > < X-Cache: MISS from bci.vizrt.internal > < X-Cache-Lookup: MISS from bci.vizrt.internal:8089 > < Via: 1.0 bci.vizrt.internal:8089 (squid/2.7.STABLE8) > < Connection: close > < > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; > charset=iso-8859-1"> > <TITLE>ERROR: The requested URL could not be retrieved</TITLE> > <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE> > </HEAD><BODY> > <H1>ERROR</H1> > <H2>The requested URL could not be retrieved</H2> > <HR noshade size="1px"> > <P> > While trying to retrieve the URL: > <A HREF="http://couchdb:5986/_fti/local/viz_data_hub/_design/lucene/search?">http://couchdb:5986/_fti/local/viz_data_hub/_design/lucene/search?</A> > <P> > The following error was encountered: > <UL> > <LI> > <STRONG> > Read Timeout > </STRONG> > </UL> > > <P> > The system returned: > <PRE><I> [No Error]</I></PRE> > > <P> > A Timeout occurred while waiting to read data from the network. The network > or server may be down or congested. Please retry your request. > <P>Your cache administrator is <A HREF="mailto:webmaster">webmaster</A>. > > <BR clear="all"> > <HR noshade size="1px"> > <ADDRESS> > Generated Thu, 30 Jan 2014 23:15:25 GMT by bci.vizrt.internal > (squid/2.7.STABLE8) > </ADDRESS> > </BODY></HTML> > * Closing connection #0 > > > And in the store.log: > > 1391123725.384 RELEASE -1 FFFFFFFF 42ACBA69A790D14B46085473EF9FC071 > 504 1391123725 -1 -1 text/html 1223/1223 GET > http://couchdb:5986/_fti/local/viz_data_hub/_design/lucene/search?q=%28directory:%22/directory/id/urn:uuid:63e5cd29-a2c0-43b9-a8fe-df4e85579c9b%22%29&skip=0&limit=50&include_docs=true > > > And in access.log: > 1391123725.384 900345 127.0.0.1 TCP_MISS/504 1565 GET > http://couchdb:5986/_fti/local/viz_data_hub/_design/lucene/search? - > FIRST_UP_PARENT/couchdb_server text/html > > > Thanks!! > > Boaz