diff --git a/storage/app/public/.htaccess b/storage/app/public/.htaccess index f1518db97..704bf5a89 100644 --- a/storage/app/public/.htaccess +++ b/storage/app/public/.htaccess @@ -1,3 +1,4 @@ +# The list should be in sync with /config/app.php and nginx config. ForceType application/octet-stream Header set Content-Disposition attachment diff --git a/tools/install.sh b/tools/install.sh index 47452464a..51de33590 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -156,6 +156,11 @@ sudo echo 'server { access_log off; add_header Cache-Control "public, must-revalidate"; } + # The list should be in sync with /storage/app/public/uploads/.htaccess and /config/app.php + location ~* ^/storage/.*\.((?!(jpg|jpeg|jfif|pjpeg|pjp|apng|bmp|gif|ico|cur|png|tif|tiff|webp|pdf|txt|diff|patch|json|mp3|wav|ogg|wma)).)*$ { + add_header Content-disposition "attachment; filename=$1"; + default_type application/octet-stream; + } location ~* ^/(?:css|fonts|img|installer|js|modules|[^\\\]+\..*)$ { expires 1M; access_log off;