On Thu, Dec 13, 2018 at 10:18 PM Sevan Gelici <[email protected]> wrote:

> Hello,
>
> Could someone help me with a problem? I want to use haproxy but cannot get
> one part working. All traffic need to pass proxy but one folder needs to be
> mask ip only.
>
> I try to explain by examples
>
> So lets say
> proxy http://111.111.111.111:8000 everything what requests here  goes to
> orginal host. That i have but i want to exclude one location somehow but
> still i want it masked.
>
> http://111.111.111.111:8000/test/
>
> My configuration works fine but only this /test part is not going well.
>
>  global
>         log /dev/log   local0
>         chroot /var/lib/haproxy
>         stats socket /run/haproxy/admin.sock mode 777 level admin
>         stats timeout 30s
>         user haproxy
>         group haproxy
>         daemon
>        maxconn 10000
>
> defaults
>         log global
>         mode http
>         maxconn 10000
>         option httplog
>         option logasap
>         option forwardfor
>         stats enable
>         stats uri /haproxy?stats
>         #Set the maximum allowed time to wait for a complete HTTP request
>         timeout http-request 5s
>         #Set the maximum time to wait for a connection attempt to a server
> to succeed.
>         timeout connect 5s
>         #Set the maximum inactivity time on the client side.
>         timeout client 5s
>         #Set the maximum inactivity time on the server side.
>         timeout server 10s
>
> frontend http
>         bind *:8080
>
>         default_backend main
>      option forwardfor header X-Forwarded-For
> capture request header Host       len 32
> capture request header Referrer len 64
> capture request header User-Agent len 64
>
>
> backend main
>        server main  111.111.111.1118080  check
>        option http-buffer-request
>         option forwardfor
>        http-request set-header X-Forwarded-Port %[dst_port]
>


>        http-request redirect location http://%[hdr(host)]/test/ code 301
> if { path /test }
>
>
This does not make much sense since you are creating infinite redirection
loop, virtually /test/ and /test are same path. What exactly did you want
to make out of this again? Not sure I understand what "masking" means?

>
> I think this part is not correct: http-request redirect location 
> http://%[hdr(host)]/test/
> code 301 if { path /test }
>
>
> I used also an another application called trafficserver but i want to use
> haproxy. In there documentation its this
>
>
> https://docs.trafficserver.apache.org/en/8.0.x/admin-guide/files/records.config.en.html
>
>
> number_of_redirections=0 | This setting determines the maximum number of
> times Trafficserver does a redirect follow location on receiving a 3XX
> Redirect response for a given client request.
>
> What can i do to get this option working on haproxy.
>
> Kind regards,
>
> Sevan Gelici
>
>

Reply via email to