I would like to configure Apache so that
- it normally denies requests for iFrames (for instance, by setting
Header always append X-Frame-Options DENY
) - but, it allows a specific directory to be embedded as iFrame, independently from the origin of the request (for instance,
)
Is that possible?
Answer
See documentation for X-Frame-Options
. You can
allow embedding from
https://example.com/mydir
:Header always append X-Frame-Options ALLOW-FROM=https://example.com/mydir
allow embedding of
https://example.com/mydir
by adding it only whenLocation
doesn't match/mydir
, with theLocationMatch
directive.
ServerName example.com
Header always append X-Frame-Options DENY
to maximize security, add a combination of these i.e. only allow embedding of
/mydir
from...
.
You can't limit it to alone, but the embedding can also be done as
or
.
Comments
Post a Comment