Skip to content

Commit

Permalink
Update apache config
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Sep 19, 2024
1 parent 6943950 commit ca91820
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spk/owncloud/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ setup_owncloud_instance()
fi
done

# Add HTTP to HTTPS redirect to Apache configuration file
# Enable HTTP Strict Transport Security in Apache configuration file
APACHE_CONF="${WEB_ROOT}/.htaccess"
if [ -f "${APACHE_CONF}" ]; then
{
echo "RewriteEngine On"
echo "RewriteCond %{HTTPS} off"
echo "RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]"
echo "<IfModule mod_headers.c>"
echo "Header always set Strict-Transport-Security \"max-age=15552000; includeSubDomains\""
echo "</IfModule>"
} >> "${APACHE_CONF}"
fi
fi
Expand Down

0 comments on commit ca91820

Please sign in to comment.