Forum Moderators: phranque

Message Too Old, No Replies

Redirection Chain / Act after forwarding

searching for a solution

         

callipo

9:48 am on Nov 5, 2009 (gmt 0)

10+ Year Member



Hallo,

I am searching for a solution for the following problem:

I want to forward (proxy) or redirect an incoming request dependent upon different rules (http haeders, cookies, etc.).

For that issue i´ve implemented the logic in perl and used mod_perl. Inside the perl script among others a webservice is requested and the result is used for the descision. This solution works fine and is running on several server.

Now I have to implement the same logic but must not use perl, pyton or something similar.

My idea is now, that the whole logic is treated by my web service. The incoming request is "forwarded" to the webservice, the webservice responds a value and the value is used as condition for proxiing or redirection.

I can "forward" the request with mod_proxy to my service, but i have no idea how (or if) i can use the response to make another forward.

The webservice could also be bound with mod_jk if it is neccessary or makes it much easier.

Have someone an idea?

Is it possible to make a request to a service and use the response as a conditional criterion?

Best Regards,
callipo

jdMorgan

2:30 pm on Nov 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Look into mod_rewrite's RewriteMap function. You can use it to invoke scripts in the URL-to-filepath translation phase of the Apache API.

Jim

callipo

10:55 am on Nov 27, 2009 (gmt 0)

10+ Year Member



A late thank for your answer.

I´ve evaluated the usage of RewriteMap but came to an other easy solution.

I use mod_proxy to forward the request to a second webserver instead of forwarding directly to the webservice. On the second webserver i deployed our standard solution with mod_perl to force a redirection.

This constellation runs fine. But i run into other problems. I will open a new toppic for that.

Thanks,
callipo