Re: Capture and alter a 404 from an internal server

2009-07-24 Thread Pedro Mata-Mouros Fonseca

Hello,


Thank you so much Maciej, I will give it a try - although in that
referenced email it seems like a scary thing to do... A hard thing to
evaluate is the cost of having such rspirep processing in every
response coming from that specific frontend... Is it too overwhelming
to the performance?


If you're running 1 request/s you should be careful not to add too
many such statements, but at lower speeds, you will almost not notice
the extra CPU usage, particularly if you've built with the PCRE  
library,

which is extremely fast. I have seen large configurations where people
use between 100 and 200 regexes per request and it does not appear to
affect them that much.



Not really running 1 reqs/sec, maybe about 1000 in peak times, so  
I'd say I'd want top performance for at least 3000 reqs/sec. If at  
3000 reqs/sec it's not a problem to use that, then it's perfect.



Wouldn't this just be a perfect candidate for having it's own
directive, in the likes of errorfile and errorloc, but specifically
only for errors returned by servers instead of only HAProxy? ;-)
Something like:

errorserverfile 404 /etc/haproxy/errorfiles/404generic.http
errorserverloc 404 http://127.0.0.1:8080/404generic.html


it might be, but I don't really know if we need the "errorserverfile"
or not. Becase if we only need the "errorserverloc" above, then you
will be able to do it using ACLs when they're usable on the response
path.



Thanks for this, using ACLs on the response path was something I  
completely missed. Of course, the errorserverloc I suggested is  
implemented by ACLs on responses. Would be, of course, nice to have  
the "errorserverfile" functionality, but it's not really something  
that cannot be accomplished with what we have now.


Cheers!

Pedro.




Re: Capture and alter a 404 from an internal server

2009-07-22 Thread Willy Tarreau
On Mon, Jul 20, 2009 at 10:11:16AM +0100, Pedro Mata-Mouros Fonseca wrote:
> Thank you so much Maciej, I will give it a try - although in that  
> referenced email it seems like a scary thing to do... A hard thing to  
> evaluate is the cost of having such rspirep processing in every  
> response coming from that specific frontend... Is it too overwhelming  
> to the performance?

If you're running 1 request/s you should be careful not to add too
many such statements, but at lower speeds, you will almost not notice
the extra CPU usage, particularly if you've built with the PCRE library,
which is extremely fast. I have seen large configurations where people
use between 100 and 200 regexes per request and it does not appear to
affect them that much.

> Wouldn't this just be a perfect candidate for having it's own  
> directive, in the likes of errorfile and errorloc, but specifically  
> only for errors returned by servers instead of only HAProxy? ;-)  
> Something like:
> 
> errorserverfile 404 /etc/haproxy/errorfiles/404generic.http
> errorserverloc 404 http://127.0.0.1:8080/404generic.html

it might be, but I don't really know if we need the "errorserverfile"
or not. Becase if we only need the "errorserverloc" above, then you
will be able to do it using ACLs when they're usable on the response
path.

Regards,
Willy




Re: Capture and alter a 404 from an internal server

2009-07-20 Thread Pedro Mata-Mouros Fonseca
Thank you so much Maciej, I will give it a try - although in that  
referenced email it seems like a scary thing to do... A hard thing to  
evaluate is the cost of having such rspirep processing in every  
response coming from that specific frontend... Is it too overwhelming  
to the performance?


Wouldn't this just be a perfect candidate for having it's own  
directive, in the likes of errorfile and errorloc, but specifically  
only for errors returned by servers instead of only HAProxy? ;-)  
Something like:


errorserverfile 404 /etc/haproxy/errorfiles/404generic.http
errorserverloc 404 http://127.0.0.1:8080/404generic.html

Thanks.

Pedro.

On Jul 19, 2009, at 7:51 PM, Maciej Bogucki wrote:


Pedro Mata-Mouros Fonseca pisze:

Greetings,

I need HAProxy to show a costumized 404 page in case an internal  
host responds with it's vanilla 404. I cannot change the 404 page  
in the internal host and it's got to be HAProxy to do it. Using  
rsprep can I find and replace the 404 Not Found with a 302 and a  
Location: new_error_page.html header?


Is this the best/only way to do it?
Thanks so much.



Hello,

You could try something like this [1].

[1] - http://www.formilux.org/archives/haproxy/0906/2144.html


Best Regards
Maciej Bogucki







Re: Capture and alter a 404 from an internal server

2009-07-19 Thread Maciej Bogucki

Pedro Mata-Mouros Fonseca pisze:

Greetings,

I need HAProxy to show a costumized 404 page in case an internal host 
responds with it's vanilla 404. I cannot change the 404 page in the 
internal host and it's got to be HAProxy to do it. Using rsprep can I 
find and replace the 404 Not Found with a 302 and a Location: 
new_error_page.html header?


Is this the best/only way to do it?
Thanks so much.



Hello,

You could try something like this [1].

[1] - http://www.formilux.org/archives/haproxy/0906/2144.html


Best Regards
Maciej Bogucki



Capture and alter a 404 from an internal server

2009-07-17 Thread Pedro Mata-Mouros Fonseca

Greetings,

I need HAProxy to show a costumized 404 page in case an internal host  
responds with it's vanilla 404. I cannot change the 404 page in the  
internal host and it's got to be HAProxy to do it. Using rsprep can I  
find and replace the 404 Not Found with a 302 and a Location:  
new_error_page.html header?


Is this the best/only way to do it?
Thanks so much.

Pedro.