Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4720

Haproxy to prevent access to all but selected URLs on a backend

$
0
0

@sinaowolabi wrote:

Hi!

I am trying to setup haproxy to block access to a backend server from a particular IP address.
I need haproxy to allow access to only three URLs on the backend server.
I came up with this, please can someone tell me if this is correct, and will work as expected?

frontend access_control
   maxconn     50000
   bind        *:8080
   mode        http
   option      httplog
   http-request deny if !{ path -i -m beg /url1/path } { src 1.1.1.1 } 
   http-request deny if !{ path -i -m beg /url2 } { src 1.1.1.1 }
   http-request deny if !{ path -i -m beg /url3 } { src 1.1.1.1 }
default_backend access_control_backend

backend access_control_backend
   mode        http
   option      httplog
   server      server1     server1:8080

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>