Skip to content

Commit

Permalink
shaarli: update apache configuration as per shaarli/Shaarli#1630
Browse files Browse the repository at this point in the history
  • Loading branch information
nodiscc committed Nov 12, 2020
1 parent c3aae86 commit e3c2115
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ MDomain {{ shaarli_fqdn }}
Header always set Content-Security-Policy "script-src 'self' 'unsafe-inline' https://www.youtube.com https://s.ytimg.com; frame-ancestors 'none'"
</Directory>

<LocationMatch "/\.">
# Prevent accessing dotfiles
RedirectMatch 404 ".*"
</LocationMatch>
# BE CAREFUL: directives order matter!
<FilesMatch ".*\.(?!(ico|css|js|gif|jpe?g|png|ttf|oet|woff2?)$)[^\.]*$">
Require all denied
</FilesMatch>

<Files "index.php">
Require all granted
</Files>

<LocationMatch "\.(?:ico|css|js|gif|jpe?g|png)$">
<FilesMatch "\.(?:ico|css|js|gif|jpe?g|png|ttf|oet|woff2)$">
# allow client-side caching of static files
Header set Cache-Control "max-age=2628000, public, must-revalidate, proxy-revalidate"
</LocationMatch>
</FilesMatch>

# serve the Shaarli favicon from its custom location
Alias favicon.ico /var/www/shaarli.mydomain.org/images/favicon.ico
Expand Down

0 comments on commit e3c2115

Please sign in to comment.