On 01/03/2016 9:57 PM, "Zoltan Lorincz" wrote:
>
> Hi all,
>
> i am very new to haproxy. Read trough all the docs but i think something
is wrong with my configuration, because if we connect directly to tomcat we
don't get any 502 errors.
>
> The errors from haproxy look like
I've found why peering was not syncing up tables - I must indicate the
peers by IP address, not by hostname. If I list peers by hostname,
HAproxy will try to connect to peers, but it refuses any peering
requests sent to itself (does not even listen to the peering TCP port).
So I made it work
Current config:
###
backend app_api
mode http
balance hdr(X-Forwarded-For)
hash-type consistent
stick on hdr(X-Forwarded-For)
stick-table type string size 5M peers api
option httpchk GET /status
default-server inter 1 rise 10 fall 2
server
Configuration now:
frontend app_api_front
bind *:80
mode http
default_backend app_api
backend app_api
mode http
balance hdr(X-Forwarded-For)
hash-type consistent
stick on hdr(X-Forwarded-For)
stick-table type string size 5M peers api
Thanks Conrad,
That sort of thing looks better that what I had, and I'll give it a go.
I still think this is a bit long winded syntax for something that probably
quite a common things to want to do? A map_contains type boolean function
still seems like a good to have?
Thanks
Neil
On 3 March
If you are using haproxy >=1.6, you might be able to do something like this:
acl no_redir %[req.redir] -m str NO_REDIR
http-request set-var(req.redir) \
%[hdr(host),map(/etc/haproxy/redirect_host.map,NO_REDIR)]
http-request redirect location %[req.redir] code 301 if !no_redir
This is
Hello
On 3/3/2016 1:40 PM, Neil - HAProxy List wrote:
> Hello
> This works but is yuck (I'd have to automate generating the acl file
> from the map - not hard but not clean). Ideally I'd like a way to only
> redirect when a value is in the map what would be fine is if there were
> a
Hello
HA-Proxy version 1.5.15 2015/11/01
I've got a service with some redirects for old virtual hosts to new
locations on main website that I want to store in a map file
/etc/haproxy/redirect_host.map with lines like
www.oldname.com http://www.shiny.net/collections/oldname
My issue is I don't
8 matches
Mail list logo