Hey,

No need to apologies, sometimes it's faster to ask than looking for
the solution for hours and building an ugly workaround.

If you need help for the setting up the solution, please let us know.

The content of the file may be:
HTTP/1.0 200 OK
Cache-Control: no-cache
Connection: close
Content-Type: text/html
Access-Control-Allow-Origin: *
Content-Length: < COUNT IT YOURSELF ;) >

==> don't forget the empty line at the end of the file.

Despite using errorfile 503, haproxy would answer a 200 OK using the file above.

cheers


On Wed, Apr 4, 2012 at 11:52 PM, Pedro Mata-Mouros
<[email protected]> wrote:
> Hi,
>
> I really should've thought of that for myself, sorry about that... :-)
>
> Thanks so much, will try it tomorrow!
>
> Pedro.
>
>
> On 04/04/2012, at 21:01, Baptiste wrote:
>
>> Hey,
>>
>> This is doable using content switching to route your request to a
>> backend where where no servers are up.
>> In this backend, just use the statement "errorfile" to tell haproxy to
>> load content of the response from a local file
>>
>> You're done.
>>
>> cheers
>>
>>
>> On Wed, Apr 4, 2012 at 8:37 PM, Pedro Mata-Mouros
>> <[email protected]> wrote:
>>> Hi everyone, Willy,
>>>
>>> Either I'm really unaware if HAProxy can do this or not, or I completely 
>>> forgot it. Is it possible to check for a specific request and promptly 
>>> return a user defined response, without the need to go to a backend?
>>>
>>> I basically need to return an empty HTTP 200 with 
>>> "Access-Control-Allow-Origin: *" whenever somebody sends me an "OPTIONS 
>>> /url HTTP/1.1", and I don't want that to be processed by the application in 
>>> the backend.
>>>
>>> Thanks.
>>>
>>> Pedro.
>>>
>>>
>>
>
>

Reply via email to