Hi,

  Here's a problem I'd like to solve.  Configure apache to receive a
request and proxy/forward it off to a backend app server (tomcat) ..
wait a specified period of time .. and no response is received send
back a static file or a return code like 204.

  Essentially it's a combination between the below mod_rewrite and
mod_alias directives with a timeout.  Below example uses solr without
loss of generality.

  RedirectMatch 204 /search/(.*)$
  RewriteRule ^/search/(.*)$ http://backend:8080/solr/$1 [P]

  Logic below:

  If url matches rewrite-rule regex then
  {
      set timer for 500ms with timer_callback()
      force proxy to secondary url after rewriting it
      if(response from proxy is > 199 and < 300)
         return response
      else
         return 204
  }

  timer_callback()
  {
     send back 204
  }

  Instead of returning 204 one could also serve back a static file.

  The general idea is to expose a url that has a near-guaranteed
response time limit where a 204 or static default is acceptable
behaviour.

  I suspect that we'll need to write an apache module to do this.. yet
surely this question has been asked before?  Ideas?

Thanks - Neal

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to