title: Intermittent errors using lighttpd + mod_proxy
body: <p>I'm running lighttpd v1.4.18 on an embedded linux device. Lighty is listening on port 80 and serves as a reverse proxy so that _http://192.168.0.1/foo1 requests are proxied to _http://127.0.0.1:11111 </p>
  
  <pre><code>### 1st appreach
  proxy.server = ( "^/foo1" =&gt; ( "" =&gt; ( "host" =&gt; "127.0.0.1", "port" =&gt; 11111 )))
  
  ### 2nd approach
  $HTTP["url"] =~ "^/foo1" { 
      proxy.server = ( "" =&gt; (( "host" =&gt; "127.0.0.1", "port" =&gt; 11111 ))) 
  }
  </code></pre>
  
  <p>Basically, this works fine. But I do encounter 404 errors on a random basis, especially after startup. If the background service "foo1" isn't be running I get a 503 error message, which makes sense. But since I can query _http://192.168.0.1:11111 thats not the case... The device is up and running an "foo1" is ready to serve incoming requests. So, why do these 404 errors crop up using either 1st of 2nd approach?!</p>
  
  <p>This is what the log reveals...</p>
  
  <pre><code>2012-03-05 08:31:36: (request.c.294) fd: 6 request-len: 164 
  POST /foo1 HTTP/1.1
  Host: 192.168.0.1
  User-Agent: gSOAP/2.7
  Content-Type: text/xml; charset=utf-8
  Content-Length: 450
  Connection: close
  SOAPAction: ""
  
  
  2012-03-05 08:31:36: (response.c.205) -- splitting Request-URI 
  2012-03-05 08:31:36: (response.c.206) Request-URI  :  /foo1
  2012-03-05 08:31:36: (response.c.207) URI-scheme   :  http 
  2012-03-05 08:31:36: (response.c.208) URI-authority:  192.168.0.1 
  2012-03-05 08:31:36: (response.c.209) URI-path     :  /foo1
  2012-03-05 08:31:36: (response.c.210) URI-query    :   
  2012-03-05 08:31:36: (response.c.260) -- sanatising URI 
  2012-03-05 08:31:36: (response.c.261) URI-path     :  /foo1
  2012-03-05 08:31:36: (mod_proxy.c.1080) proxy - start 
  2012-03-05 08:31:36: (response.c.375) -- before doc_root 
  2012-03-05 08:31:36: (response.c.376) Doc-Root     : /var/www 
  2012-03-05 08:31:36: (response.c.377) Rel-Path     : /foo1
  2012-03-05 08:31:36: (response.c.378) Path         :  
  2012-03-05 08:31:36: (response.c.426) -- after doc_root 
  2012-03-05 08:31:36: (response.c.427) Doc-Root     : /var/www 
  2012-03-05 08:31:36: (response.c.428) Rel-Path     : /foo1
  2012-03-05 08:31:36: (response.c.429) Path         : /var/www/foo1
  2012-03-05 08:31:36: (response.c.446) -- logical -&gt; physical 
  2012-03-05 08:31:36: (response.c.447) Doc-Root     : /var/www 
  2012-03-05 08:31:36: (response.c.448) Rel-Path     : /foo1
  2012-03-05 08:31:36: (response.c.449) Path         : /var/www/foo1
  2012-03-05 08:31:36: (response.c.466) -- handling physical path 
  2012-03-05 08:31:36: (response.c.467) Path         : /var/www/foo1
  2012-03-05 08:31:36: (response.c.523) -- file not found 
  2012-03-05 08:31:36: (response.c.524) Path         : /var/www/foo1
  2012-03-05 08:31:36: (response.c.114) Response-Header: 
  HTTP/1.1 404 Not Found
  Connection: close
  Content-Type: text/html
  Content-Length: 345
  Date: Mon, 05 Mar 2012 07:31:36 GMT
  Server: lighttpd
  </code></pre>
  
  <p>And this is what I expect to see...</p>
  
  <pre><code>2012-03-05 08:42:43: (request.c.294) fd: 6 request-len: 164 
  POST /foo1 HTTP/1.1
  Host: 192.168.0.1
  User-Agent: gSOAP/2.7
  Content-Type: text/xml; charset=utf-8
  Content-Length: 450
  Connection: close
  SOAPAction: ""
  
  
  2012-03-05 08:42:43: (response.c.205) -- splitting Request-URI 
  2012-03-05 08:42:43: (response.c.206) Request-URI  :  /foo1 
  2012-03-05 08:42:43: (response.c.207) URI-scheme   :  http 
  2012-03-05 08:42:43: (response.c.208) URI-authority:  192.168.0.1
  2012-03-05 08:42:43: (response.c.209) URI-path     :  /foo1 
  2012-03-05 08:42:43: (response.c.210) URI-query    :   
  2012-03-05 08:42:43: (response.c.260) -- sanatising URI 
  2012-03-05 08:42:43: (response.c.261) URI-path     :  /foo1 
  2012-03-05 08:42:43: (mod_proxy.c.1080) proxy - start 
  2012-03-05 08:42:43: (mod_proxy.c.1116) proxy - ext found 
  2012-03-05 08:42:43: (mod_proxy.c.1159) proxy - used fair balancing 
  2012-03-05 08:42:43: (mod_proxy.c.1240) proxy - found a host 127.0.0.1 11111 
  2012-03-05 08:42:43: (response.c.375) -- before doc_root 
  2012-03-05 08:42:43: (response.c.376) Doc-Root     : /var/www 
  2012-03-05 08:42:43: (response.c.377) Rel-Path     : /foo1 
  2012-03-05 08:42:43: (response.c.378) Path         :  
  2012-03-05 08:42:43: (response.c.426) -- after doc_root 
  2012-03-05 08:42:43: (response.c.427) Doc-Root     : /var/www 
  2012-03-05 08:42:43: (response.c.428) Rel-Path     : /foo1 
  2012-03-05 08:42:43: (response.c.429) Path         : /var/www/foo1 
  2012-03-05 08:42:43: (response.c.446) -- logical -&gt; physical 
  2012-03-05 08:42:43: (response.c.447) Doc-Root     : /var/www 
  2012-03-05 08:42:43: (response.c.448) Rel-Path     : /foo1 
  2012-03-05 08:42:43: (response.c.449) Path         : /var/www/foo1 
  2012-03-05 08:42:43: (mod_proxy.c.377) connect delayed: 7 
  2012-03-05 08:42:43: (mod_proxy.c.994) proxy: fdevent-out 1 
  2012-03-05 08:42:43: (mod_proxy.c.805) proxy - connect - delayed success 
  2012-03-05 08:42:43: (mod_proxy.c.961) proxy: fdevent-in 4 
  2012-03-05 08:42:43: (mod_proxy.c.645) proxy - have to read: 607 
  2012-03-05 08:42:43: (mod_proxy.c.961) proxy: fdevent-in 4 
  2012-03-05 08:42:43: (mod_proxy.c.645) proxy - have to read: 0 
  2012-03-05 08:42:43: (response.c.114) Response-Header: 
  HTTP/1.1 200 OK
  Connection: close
  Server: gSOAP/2.7
  Content-Type: text/xml; charset=utf-8
  Content-Length: 490
  Date: Mon, 05 Mar 2012 07:42:43 GMT
  </code></pre>
  
  <p>Would a newer version fix that problem? Any other suggestions? </p>
  
  <p>Many thanks in advance!</p>