Hi Jarno Thanks for your reply.
I have added following lines in frontend acl main_site req.hdr(Host) -i http://www.abc.com <http://oms.abc.com/> http-response add-header X-Frame-Options ALLOW-FROM\ http://oms.naaptol.com if main_site http-response add-header X-Frame-Options SAMEORIGIN if ! main_site I got some error : [WARNING] 074/135257 (35900) : parsing [/opt/haproxy-ssl/haproxy.cfg:42] : acl 'main_site' will never match because it only involves keywords that are incompatible with 'backend http-response header rule' [WARNING] 074/135257 (35900) : parsing [/opt/haproxy-ssl/haproxy.cfg:43] : acl 'main_site' will never match because it only involves keywords that are incompatible with 'backend http-response header rule' Devendra Joshi 8080106035 -------------------------------------------------------------- -------------------------------------------------------------- On 16 March 2017 at 13:21, Jarno Huuskonen <jarno.huusko...@uef.fi> wrote: > Hi, > > On Thu, Mar 16, Devendra Joshi wrote: > > Any one one know how to set X-Frame-Options with SAMEORIGIN & ALLOW-FROM > in > > HaProxy > > > > I added one setting in haproxy config file but showing error. > > > > acl main_site req.hdr(Host) http://www.abc.com > > http-response add-header X-Frame-Options:\ ALLOW-FROM\ > http://oms.abc.com if > > main_site > > http-response add-header X-Frame-Options:\ SAMEORIGIN if ! main_site > > http-response add-header X-Frame-Options ALLOW-FROM\ http://oms.abc.com > if main_site > http-response add-header X-Frame-Options SAMEORIGIN if ! main_site > (https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#4-http- > response) > > (but AFAIK the request acl won't work on http-response rule). > > -Jarno > > > > > Error is : > > [ALERT] 074/100716 (29069) : parsing [/opt/haproxy-ssl/haproxy.cfg:42]: > > 'http-response add-header' expects exactly 2 arguments. > > [ALERT] 074/100716 (29069) : parsing [/opt/haproxy-ssl/haproxy.cfg:43]: > > 'http-response add-header' expects exactly 2 arguments. > > > > Please suggest what syntax should i use for this. > > I am using HA-Proxy version 1.5.14 > > -- > Jarno Huuskonen >