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

How to add Cookies on http request not on http response

$
0
0

@pankaj.ghadge wrote:

Hi,

Can we add cookies on http request instead of http response like below:

backend app-backend
    mode http
    option httpclose
    balance leastconn
    cookie SERVERID insert indirect nocache
    server app1 10.89.1.10:80 check cookie app1 http-request add-header cookies SERVERID app1
    server app2 10.89.1.20:80 check cookie app2 http-request add-header cookies SERVERID app2

Or

Can we add in URL Parameter in request if SERVERID is not present in URL like below

backend app-backend
     mode http
     option httpclose
     balance leastconn
     cookie SERVERID insert indirect nocache
     server app1 10.89.1.10:80 check cookie app1 http-request set-uri https://%[req.hdr(Host)]%[path]?%[query]&SERVERID=app1 if SERVERID in URL NOT FOUND
     server app2 10.89.1.20:80 check cookie app2 http-request set-uri http://%[req.hdr(Host)]%[path]?%[query]&SERVERID=app2 if SERVERID in URL NOT FOUND

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4739

Trending Articles



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