logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Header set X-XSS-Protection "1; mode=block" -- not
Author
alexjohnb



Joined: 26 Aug 2011
Posts: 22
Location: Middlesex University

PostPosted: Tue 17 Oct '17 14:49    Post subject: Header set X-XSS-Protection "1; mode=block" -- not Reply with quote

I am having trouble getting the directive

Header set X-XSS-Protection "1; mode=block"

to have any effect.

My question:

In my websites various conf files, I have this stanza:

<IfModule mod_headers.c>
# Allow some urls, block all others; whitelisting
<LocationMatch ^((?!(xxxxxx)).)*$>
Header always append X-Frame-Options SAMEORIGIN
</LocationMatch>
Header always append X-Frame-Options "ALLOW-FROM http://xxxxxxxx.azurewebsites.net/"
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Header set X-XSS-Protection "1; mode=block"
</IfModule>


Will the directive <IfModule mod_headers.c> take effect if

LoadModule headers_module modules/mod_headers.so

is in the httpd.conf file, or does it also have to be in any <VirtualHost> stanzas which make use of it? Or should it be

<IfModule headers_module>?

Please advise.

Many thanks.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 19 Oct '17 14:16    Post subject: Reply with quote

See http://httpd.apache.org/docs/2.4/en/mod/core.html#ifmodule
Back to top


Reply to topic   Topic: Header set X-XSS-Protection "1; mode=block" -- not View previous topic :: View next topic
Post new topic   Forum Index -> Apache