Skip to content

Commit

Permalink
v8.25
Browse files Browse the repository at this point in the history
- DietPi-Software | Nextcloud: Update Lighttpd and Nginx configs, especially add .mjs files to list of static resources: nextcloud/server#38688
  • Loading branch information
MichaIng committed Dec 2, 2023
1 parent 771a336 commit cb2fc60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions .conf/dps_114/lighttpd.nextcloud.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ url.redirect += (
)

$HTTP["url"] =~ "^/nextcloud($|/)" {

# Hardening
# - Directories
$HTTP["url"] =~ "^/nextcloud/(build|tests|config|lib|3rdparty|templates|data)($|/)" { url.access-deny = ("") }
Expand All @@ -18,7 +17,7 @@ $HTTP["url"] =~ "^/nextcloud($|/)" {
# - Directory listing
dir-listing.activate = "disable"
# - Security and cache control headers for static resources
$HTTP["url"] =~ "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite|map|woff2?)$" {
$HTTP["url"] =~ "\.(css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|woff2?)$" {
setenv.add-response-header += (
"Referrer-Policy" => "no-referrer",
"X-Content-Type-Options" => "nosniff",
Expand All @@ -30,15 +29,13 @@ $HTTP["url"] =~ "^/nextcloud($|/)" {
"Cache-Control" => "public, max-age=15778463",
)
}

# Rewrites
url.rewrite-once += (
"^/nextcloud/remote/(.*)" => "/nextcloud/remote.php/$1",
"^/nextcloud/ocm-provider($|/\?.*)" => "/nextcloud/index.php$1"
)
url.rewrite-if-not-file += (
"^/nextcloud/((core/ajax/update|cron|public|remote|status|ocs/v[12])\.php|ocs-provider/|updater/)" => "",
"^/nextcloud/((core/ajax/update|cron|public|remote|status|ocs/v[12]|richdocumentscode(_arm64)?/proxy)\.php|ocs-provider/|updater/)" => "",
"^/nextcloud(.*)" => "/nextcloud/index.php$1"
)

}
2 changes: 1 addition & 1 deletion .conf/dps_114/nginx.nextcloud.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ location ^~ /nextcloud {
fastcgi_max_temp_file_size 0; # Allow downloads > 1 GiB: https://github.com/nextcloud/documentation/pull/7979
}

location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
try_files $uri /nextcloud/index.php$request_uri;
expires 6M; # Cache-Control policy borrowed from `.htaccess`
access_log off; # Optional: Don't log access to assets
Expand Down

0 comments on commit cb2fc60

Please sign in to comment.