Httpd – Adding missing header in Apache HTTP response

apache-2.4centos7http-headershttpdrhel7

Does anybody know of a way to set a HTTP response header only if it is missing from the initial created response (proxied response via mod_jk) in Apache HTTP 2.4.6? I'm looking for a way to set the X-FRAME-OPTIONS header but only if the source page has not explicitly set it.

I know Apache HTTP 2.4 has the setifempty action from mod_header but that doesn't exist until Apache HTTP 2.4.7. I don't want to change the apache version because then it would take me out of my distribution's (CentOS 7) update path.

Best Answer

Found that the apache 2.2 version works well from this older post.

https://serverfault.com/a/709170/332017