I am trying to check if header does not exist then proxy to a login url else to a different url
Re-write / to /login if X-Login-Token
rewrite / {
if not {>X-Login-Token} is "" ##### CHECK FOR EXISTENCE ####
##### The if condition does not have a exist operator, any alternatives ?
to /login{path}
}
# Re-write / to /web_server
rewrite / {
if not {>X-Login-Token} is ""
to /web_server{path}
}
I checked those out, however it seems the conditions expect two operands A and B where exists check is for a single operand. Thanks anyway. I will try to use match with regex null ^$ and see if it works.