Re: Specific kind of 404 handling

2022-03-28 Thread Andrew Smalley
Hi Shawn

Thank you for your response saying you got everything working with
default errorfiles on a 404 error. .

Happy to see that resolved the issues for you.

Andruw Smalley

Loadbalancer.org Ltd.

www.loadbalancer.org

+1 888 867 9504 / +44 (0)330 380 1064
asmal...@loadbalancer.org

Leave a Review | Deployment Guides|Blog

Andruw Smalley

Loadbalancer.org Ltd.

www.loadbalancer.org

+1 888 867 9504 / +44 (0)330 380 1064
asmal...@loadbalancer.org

Leave a Review | Deployment Guides|Blog



On Mon, 28 Mar 2022 at 15:01, Shawn Heisey  wrote:
>
> On 3/28/22 03:21, Andrew Smalley wrote:
> > Now the unknown host header,, you want this.com and the user requests
> > that.com and now what do we do? add a host header? reject by host
> > header
>
> Handling invalid host headers like I want was already done, by the
> default virtualhost in Apache.
>
> I managed to get everything working exactly how I want it to work, by
> changing my google searches a little bit and finding some howto guides.
> It was pretty easy in the end.  I removed the 404 redirect in Apache and
> in haproxy.cfg made the following changes.
>
> A new section:
>
> http-errors myerrors
>  errorfile 404 /etc/haproxy/errors/404.http
>
> And under my frontend:
>
> frontend web
>  errorfiles myerrors
>  http-response return  status 404  default-errorfiles  if { status 404 }
>
> Thanks,
> Shawn
>
>



Re: Specific kind of 404 handling

2022-03-28 Thread Shawn Heisey

On 3/28/22 03:21, Andrew Smalley wrote:

Now the unknown host header,, you want this.com and the user requests
that.com and now what do we do? add a host header? reject by host
header


Handling invalid host headers like I want was already done, by the 
default virtualhost in Apache.


I managed to get everything working exactly how I want it to work, by 
changing my google searches a little bit and finding some howto guides.  
It was pretty easy in the end.  I removed the 404 redirect in Apache and 
in haproxy.cfg made the following changes.


A new section:

http-errors myerrors
    errorfile 404 /etc/haproxy/errors/404.http

And under my frontend:

frontend web
    errorfiles myerrors
    http-response return  status 404  default-errorfiles  if { status 404 }

Thanks,
Shawn




HAProxy 2.5.5 and Log-Forward issue with keeping sending host address in syslog message

2022-03-28 Thread JPIM (Jan Primdahl Madsen)
Hello HAProxy users

I'm currently trying to get HAProxy as my main LB for syslog messages TCP and 
UDP messages for network devices in front of a syslog cluster.
For the UDP messages I'm struggling get the correct sender address in the 
messages being forwarded to backend servers.

All the time I see one of 2 things in my message.

  *   Localhost IP (127.0.0.1 translated to localhost in the logs)
  *   _gateway IP(which is the GW infront of the HAProxy LB)
  *   Or - (Yes just a - no IP or hostname !)

But the actually sending hosts keeps getting stripped/replaced from the 
messages.

I tried the following different configuration now:
log-forward syslogUDPFrontend-10514
# Listen on UDP and TCP 10514
dgram-bind "${vipAddr}":10514
log 152.73.245.2:10514 format local local0

Host received on rsyslog side:
_gateway.log
Mar 28 11:19:51 _gateway 11605603: 11605648: Mar 28 09:19:50.982: 
%ILPOWER-5-DETECT: Interface Te2/0/13: Power Device detected: IEEE PD

log-forward syslogUDPFrontend-10514
# Listen on UDP and TCP 10514
dgram-bind "${vipAddr}":10514
log 152.73.245.2:10514 format rfc3164 local0

Host received on rsyslog side:
 Localhost.log
 Mar 28 11:21:02 localhost 1004931: 1005091: Mar 28 
2022 09:21:02.102 UTC: %LINK-3-UPDOWN: Interface GigabitEthernet3/0/39, changed 
state to down

log-forward syslogUDPFrontend-10514
# Listen on UDP and TCP 10514
dgram-bind "${vipAddr}":10514
log 152.73.245.2:10514 format rfc5425 local0

Host receiving on rsyslog side:
 -.log
 Mar 28 10:49:07 - - 1093665: 1093708: Mar 28 2022 
08:49:06.471 UTC: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/9, changed state 
to down

I also tried adding the log global section and have the following line in the 
global section:
log-send-hostname %H
log-send-hostname

Still giving me the some changed hostnames in the syslog strings !

Any suggestions of wrong configuration or something I missed are very much 
appreciated.
Or maybe what I want, can't be done with HAProxy ?

Best regards
Jan

This e-mail (including any attachments) is intended for the addressee(s) stated 
above only and may contain confidential information protected by law. You are 
hereby notified that any unauthorized reading, disclosure, copying or 
distribution of this e-mail or use of information contained herein is strictly 
prohibited and may violate rights to proprietary information. If you are not an 
intended recipient, please return this e-mail to the sender and delete it 
immediately hereafter. Thank you.


Re: Specific kind of 404 handling

2022-03-28 Thread Andrew Smalley
Hi Shawn


If I read your question right then you wan to serve other content on
an error, say 404 as a not found,.

haproxy has the ability to serve either error files of its own or
use_server or use_backend on error as an ACL

Below is an example error file and these need to be crafted, ill add a
link to them at the end


frontend www
...
default_backend nomatch

backend nomatch
errorfile 503 /var/www/http/404.http


OR you an use an ACL to get a similar result

frontend www
  ...
  default_backend no-match

backend no-match
  mode http
  http-request deny deny_status 400


http://cbonte.github.io/haproxy-dconv/1.9/configuration.html#4-http-request


Now the unknown host header,, you want this.com and the user requests
that.com and now what do we do? add a host header? reject by host
header

ill request a serverfault page for that and ask your forgiveness here
for not typing it all out for you ;) someone already did that for me
below

https://serverfault.com/questions/876871/configure-haproxy-to-include-host-headers-for-different-backends

Here at loadbalancer.org we have also been asked of a way to send the
host header as the real server label/name to the backend, this may
also work for you

listen example_vs
bind 172.31.31.103:80 transparent
id 680753459
mode http
**http-send-name-header Host**
balance leastconn
cookie SERVERID maxidle 30m maxlife 12h insert secure attr
"SameSite=None" attr "HttpOnly" nocache indirect
server backup 127.0.0.1:9081 backup  non-stick
option http-keep-alive
timeout http-request 5s
option forwardfor
timeout tunnel 1h
option redispatch
option abortonclose
maxconn 4
server **host.loadbalancer.org** 172.31.31.103:80 id 1387952112
weight 100  cookie host.loadbalancer.org  check port 80 inter 4000
rise 2  fall 2  slowstart 8000 minconn 0  maxconn 0  on-marked-down
shutdown-sessions


Where I added ** ** this shows where haproxy gets the hostname and
sends to host.loadbalancer.org with that hostname.

Now the custom error files, haproxy has a wonderful page which shows
how to do these

https://www.haproxy.com/blog/serve-dynamic-custom-error-pages-with-haproxy/

If I missed anything or if you have any further questions do not hesitate to ask



Andruw Smalley

Loadbalancer.org Ltd.

www.loadbalancer.org

+1 888 867 9504 / +44 (0)330 380 1064
asmal...@loadbalancer.org

Leave a Review | Deployment Guides|Blog

Andruw Smalley

Loadbalancer.org Ltd.

www.loadbalancer.org

+1 888 867 9504 / +44 (0)330 380 1064
asmal...@loadbalancer.org

Leave a Review | Deployment Guides|Blog



On Sat, 26 Mar 2022 at 23:50, Shawn Heisey  wrote:
>
> I would like to do a specific kind of 404 handling.  I did look for a
> way to do this before asking here.  I bet it's out there, I just haven't
> found the right search keywords.
>
> I have a virtualhost in Apache ... it is the first virtualhost in
> /etc/apache2/sites-enabled, configured without ServerName or ServerAlias
> so it is the default virtualhost that handles any hostname that is not
> specified in another virtualhost.  If somebody types an incorrect
> hostname in a URL that happens to point at my server, Apache gives them
> my 404 page, without changing the URL they entered.  Examples:
>
> https://unknown.elyograg.org/
> https://rand.elyograg.org/
> https://mickeymouse.elyograg.org/donaldduck
>
> I have 404 handling in Apache as well, so if an invalid URL path is
> specified on a valid hostname, they also get that page.  But in those
> cases, it is accomplished with a redirect to
> https://unknown.elyograg.org, so the URL changes in the user's browser.
>
> I would like to make it so that the presentation of the 404 page is
> always seamless, not a redirect.
>
> I have haproxy in front of all my websites, and various things including
> Apache 2.4 on port 81 behind that.  Can haproxy do what I'm after?  Can
> Apache?  Can it be accomplished with some combination of configs in both?
>
> Thanks,
> Shawn
>
>



Słowa kluczowe do wypozycjonowania

2022-03-28 Thread Wiktor Nurek
Dzień dobry,

zapoznałem się z Państwa ofertą i z przyjemnością przyznaję, że przyciąga uwagę 
i zachęca do dalszych rozmów. 

Pomyślałem, że może mógłbym mieć swój wkład w Państwa rozwój i pomóc dotrzeć z 
tą ofertą do większego grona odbiorców. Pozycjonuję strony www, dzięki czemu 
generują świetny ruch w sieci.

Możemy porozmawiać w najbliższym czasie?


Pozdrawiam,
Wiktor Nurek



Re: [ANNOUNCE] haproxy-2.6-dev4

2022-03-28 Thread Amaury Denoyelle
On Sun, Mar 27, 2022 at 12:09:22AM +0500, Илья Шипицин wrote:
> сб, 26 мар. 2022 г. в 22:23, Ionel GARDAIS  >:
> > Thanks Willy for these updates.
> >
> > While skimming the result on the interop website, I was surprised that
> > haproxy is always more than 50% slower than its competitor.
> > Is it because you've enable lots of traces as part of your debugging
> > process for the runs ?
> >
> looks like this dockerfile is used
> https://github.com/haproxytech/haproxy-qns/blob/master/Dockerfile
> 

Hi,

Thanks for your interest on haproxy QUIC implementation :) Indeed the
perfs results reported by the interop test suite for haproxy look
miserable. To be honest, at the moment I did not look how these tests
are implemented. We left this part out as we dealt with plenty of
functional issues. As such, we enabled a lot of traces and debug options
to be able to quickly understand bugs, so this may have an impact on the
results of perfs test.

Now, we are focused on trying to deploy QUIC on haproxy.org to inspect
the behavior with real-life browsers. When this is done, the next
objective will be to try to improve the results of these perfs tests.

-- 
Amaury Denoyelle