I can't look at the backend server as it is slideshare.net.

To answer your question Cyril...requests coming to the front-end will be of
the form:

<haproxy host>/slideshare...

I want to rewrite all instances of /slideshare -> /api/2/get_slideshow

and then reverse proxy the result to www.slideshare.net:

<haproxy host>/slideshare -> www.slideshare.net/api/2/get_slideshow





On Thu, Mar 6, 2014 at 2:04 PM, Cyril Bonté <cyril.bo...@free.fr> wrote:

> Hi,
>
> Le 06/03/2014 22:42, Steve Phillips a écrit :
>
>  Haven't gotten a response on this...trying again...any help appreciated.
>>
>
> Patrick Hemmer already replied to the list yesterday (but without
> including your email address).
>
>
>> Trying to reverse proxy all requests to
>>
>> /slideshare
>>
>> to
>>
>> www.slideshare.net/api/2/get_slideshow
>> <http://www.slideshare.net/api/2/get_slideshow>
>>
>>
>> my front-end config:
>>
>>   acl url_slideshare   path_dir       slideshare
>>   use_backend slideshare         if url_slideshare
>>
>> and back-end:
>>
>> backend slideshare
>>    option http-server-close
>>    option httpclose
>>    reqrep ^([^\ ]*)\ /slideshare(.*)      \1\ /api/2/get_slideshow\2
>>    server slideshare www.slideshare.net:443
>> <http://www.slideshare.net:443> ssl verify none
>>
>>
>> requests to /slideshow however, are not being rewritten:
>>
>
> uh ? Why would you want /slideshow to be rewritten if your regex is
> designed for /slideshare ?
>
>
>> 173.11.67.214:60821 <http://173.11.67.214:60821>
>>
>> [04/Mar/2014:19:49:03.257] main slideshare/slideshare
>> 6142/0/289/121/6552 404 9299 - - ---- 0/0/0/0/0 0/0 {} "GET
>> /slideshare?slideshow_url=http%3A%2F%2Fwww.slideshare.net
>> <http://2Fwww.slideshare.net>%2FAaronKlein1%2Foptimizing-
>> aws-economics&detailed=1&api_key=msCpLON8&hash=
>> a7fe5fd52cc86e4a4a3d1022cb7c63476b79e044&ts=1393980574
>>
>> HTTP/1.1"
>>
>> Is my regex incorrect?  Am I missing something else?
>>
>
> The regex is valid, it depends on what you *really* want to do.
> As Patrick said :
> "
> The haproxy log contains the original request, not the rewritten one. If
> you want to see the rewritten URL you need to look at the backend server
> which is receiving the request.
>
> -Patrick
> "
>
> --
> Cyril Bonté
>

Reply via email to