Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1C6E1810F for ; Fri, 18 Dec 2015 13:05:43 +0000 (UTC) Received: (qmail 37132 invoked by uid 500); 18 Dec 2015 13:05:39 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 37092 invoked by uid 500); 18 Dec 2015 13:05:39 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 37082 invoked by uid 99); 18 Dec 2015 13:05:38 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 13:05:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 841B01A135E for ; Fri, 18 Dec 2015 13:05:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id zvv8vRS4xO7t for ; Fri, 18 Dec 2015 13:05:33 +0000 (UTC) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 5A77020428 for ; Fri, 18 Dec 2015 13:05:32 +0000 (UTC) Received: by mail-wm0-f53.google.com with SMTP id l126so64814755wml.1 for ; Fri, 18 Dec 2015 05:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Xu62n8okhuz6KK3tRZhPihho+toxmJPtS+lDYlz5j24=; b=UuTVyKSwucGGmSgazlvjssf2iGzjkZzOhkarS1aEmFEp8yjGTgytZDL74aeKebaBiY rjOcyCWjnF0WaEAO8RvadDEzkOBayuex6ivbnwoHsohOrDvsbjGwn0kPlxQHAtrXr2fx a18bQhEwhrchZdjf/qF9YUTANTwGLiS0az/cz8l0CFFhCLr4TxDaXDygLv9FgCD3JjQ8 mvB/zw/tLNmKx6MCVFaQsBiAue/gNSuLSjXJm38N/nu6eJDMuXUjtWjFHOGolQCVizly XE56FPnmqW6u45xXpDkiAeDzDAZ3eUZNxhRYQcxa7Mp8/aePLdB0j/qyrf+Wr1mkK/4D WZ0Q== MIME-Version: 1.0 X-Received: by 10.194.250.39 with SMTP id yz7mr4494652wjc.92.1450443925100; Fri, 18 Dec 2015 05:05:25 -0800 (PST) Received: by 10.28.156.139 with HTTP; Fri, 18 Dec 2015 05:05:25 -0800 (PST) In-Reply-To: References: Date: Fri, 18 Dec 2015 18:35:25 +0530 Message-ID: From: Jose Thomas To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=001a11c29d82ec1e4005272bca37 Subject: Re: [users@httpd] Refiring requests to proxy backend --001a11c29d82ec1e4005272bca37 Content-Type: text/plain; charset=UTF-8 Jim, Sorry, I could not find the documentation on how to do this using mod_lua. Can you please point me there ? In my current setup which is on httpd 2.2 - we use modpython. For routing requests (based on a header) we use a simple python script. For refiring the request (when a custom response code is received), another python script is configured in a "PythonOutputFilter". That script internally uses the python requests library. We are upgrading to httpd 2.4 and wanted to see if this code can be ported to mod_lua. I have already ported the first script (routing) to lua. Where i am clueless, is how to resend the request to backend for the 2nd script in a "LuaOutputFilter". Thanks & regards, Jose On Fri, Dec 18, 2015 at 5:08 PM, Jim Jagielski wrote: > In general, if you prepend the URL w/ 'proxy:' and then > use it in a subrequest, it will be processed as a proxy > request. > > On Dec 17, 2015, at 9:21 AM, Jose Thomas wrote: > > > > All, > > > > I am using httpd 2.4 with mod_proxy (http) routing requests to multiple > backends. > > > > I have a strange requirement. If a backend responds with a custom > response code - i need to re-execute the request to a different backend. > > > > What would be the right way to implement this functionality ? > > > > I was looking at mod_lua for a solution. The idea is to use a > "LuaOutputFilter" to check the response code, and then re-execute the > request with a different backend. How can i refire the request ? Should i > use a lua httpclient library for this ? Is there a easier way to do this ? > > > > Any other suggestions/comments are welcome. > > > > Version of stack > > * Apache 2.4.6 > > * Lua 5.1.4 > > > > Regards, > > Jose > > ____________ > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > --001a11c29d82ec1e4005272bca37 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Jim,

Sorry, I could not find t= he documentation on how to do this using mod_lua. Can you please point me t= here ?

In my current setup which is on httpd 2.2 - we us= e modpython. For routing requests (based on a header) we use a simple pytho= n script. For refiring the request (when a custom response code is received= ), another python script is configured in a "PythonOutputFilter".= That script internally uses the python requests library.

We are upgrading to httpd 2.4 and wanted to see if this code can be porte= d to mod_lua. I have already ported the first script (routing) to lua. Wher= e i am clueless, is how to resend the request to backend for the 2nd script= in a "LuaOutputFilter".

Thanks & reg= ards,
Jose

On Fri, Dec 18, 2015 at 5:08 PM, Jim Jagielski <jim@jagunet.com<= /a>> wrote:
In general, if you = prepend the URL w/ 'proxy:' and then
use it in a subrequest, it will be processed as a proxy
request.
> On Dec 17, 2015, at 9:21 AM, Jose Thomas <jostho@gmail.com> wrote:
>
> All,
>
> I am using httpd 2.4 with mod_proxy (http) routing requests to multipl= e backends.
>
> I have a strange requirement. If a backend responds with a custom resp= onse code - i need to re-execute the request to a different backend.
>
> What would be the right way to implement this functionality ?
>
> I was looking at mod_lua for a solution. The idea is to use a "Lu= aOutputFilter" to check the response code, and then re-execute the req= uest with a different backend. How can i refire the request ? Should i use = a lua httpclient library for this ? Is there a easier way to do this ?
>
> Any other suggestions/comments are welcome.
>
> Version of stack
> * Apache 2.4.6
> * Lua 5.1.4
>
> Regards,
> Jose
> ____________
>
>
>


---------------------------------------------------------------= ------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


--001a11c29d82ec1e4005272bca37--