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

Http-response set-header with condition, not working

$
0
0

@muelli wrote:

Hello forum,

I need to set a http-response header under certain conditions.
My idea was to use this configuration in the frontend section:

acl path_set path_beg /some/path
http-response del-header Pragma if path_set
http-response set-header Cache-Control no-cache if path_set
http-response set-header Expires -1 if path_set

However, if I run a check on the config, haproxy tells me:

acl ‘path_set’ will never match because it only involves keywords that are incompatible with ‘frontend http-response header rule’

And indeed, the rule does not work. If I remove the condition (if…) the headers are set but of course for all paths.
Can someone help me understand, why this happens and how I prevent/fix this, so the condition works?

Thanks alot,
Hans

edit: I use haproxy version 1.6.13 on this server. Could it be a version problem?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4717

Trending Articles



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