how can I properly setup my header configuration, when nextcloud is in a subfolder?
The nextcloud folder is unter /var/www/nextcloud including the standard .htaccess.
Unter /etc/apache2/sites-enabled/ are two files:
000-default.conf nextcloud.conf
If I check under https://securityheaders.com my nextcloud url, there are no config errors, but if I setup a .htaccess unter main (www), there is no effect. If I check my domain (alone), no headers are secured.
If I save these settings in 000-default.conf , the configuration seems to have duplicates on domain/nextcloud. securityheaders.com gives me an A rating, but nextcloud tells me these options are missing (when they have doublicates).
<IfModule mod_env.c>
# Add security and privacy related headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Download-Options "noopen"
Header set X-Permitted-Cross-Domain-Policies "none"
Header set Referrer-Policy "no-referrer"
Header set X-Frame-Options "SAMEORIGIN"
Header always set Feature-Policy "autoplay 'none';camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'"
Header set Content-Security-Policy "none"
SetEnv modHeadersAvailable true
</IfModule>