Enforce HTTP Strict Transport Security (HSTS)
Besides enforcing HSTS this commmit removes the two unnecessary files nextcloud.sh and default hostname
This commit is contained in:
parent
56e9d71a0e
commit
54cc5baccc
4 changed files with 2 additions and 42 deletions
|
@ -19,8 +19,8 @@ server {
|
|||
# Add headers to serve security related headers
|
||||
# Before enabling Strict-Transport-Security headers please read into this
|
||||
# topic first.
|
||||
# add_header Strict-Transport-Security "max-age=15768000;
|
||||
# includeSubDomains; preload;";
|
||||
add_header Strict-Transport-Security "max-age=15768000;
|
||||
includeSubDomains; preload;";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#!/bin/bash
|
||||
ocpath='/var/www/nextcloud'
|
||||
htuser='www-data'
|
||||
htgroup='www-data'
|
||||
rootuser='root'
|
||||
|
||||
printf "Creating possible missing Directories\n"
|
||||
mkdir -p $ocpath/data
|
||||
mkdir -p $ocpath/assets
|
||||
mkdir -p $ocpath/updater
|
||||
|
||||
printf "chmod Files and Directories\n"
|
||||
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
|
||||
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
|
||||
chmod 755 ${ocpath}
|
||||
|
||||
printf "chown Directories\n"
|
||||
chown -R ${rootuser}:${htgroup} ${ocpath}/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/config/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/data/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
|
||||
chown -R ${htuser}:${htgroup} ${ocpath}/updater/
|
||||
|
||||
chmod +x ${ocpath}/occ
|
||||
|
||||
printf "chmod/chown .htaccess\n"
|
||||
if [ -f ${ocpath}/.htaccess ]
|
||||
then
|
||||
chmod 0644 ${ocpath}/.htaccess
|
||||
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
|
||||
fi
|
||||
if [ -f ${ocpath}/data/.htaccess ]
|
||||
then
|
||||
chmod 0644 ${ocpath}/data/.htaccess
|
||||
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
|
||||
fi
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -5,4 +5,3 @@ admin-user
|
|||
admin-pass
|
||||
uri
|
||||
version
|
||||
hostname
|
||||
|
|
Loading…
Reference in a new issue