diff --git a/nginx.conf b/nginx.conf index 1551adcb..4a7b3d34 100644 --- a/nginx.conf +++ b/nginx.conf @@ -60,6 +60,9 @@ http { } location /media { + if ( $request_filename ~ '^.*/(.+)$' ) { + add_header Content-Disposition 'attachment; filename="$1"'; + } # The media files mounted in the docker volume sendfile on; diff --git a/nginx.dev.conf b/nginx.dev.conf index 5ca4399b..c997129f 100644 --- a/nginx.dev.conf +++ b/nginx.dev.conf @@ -50,6 +50,9 @@ http { } location /media { + if ( $request_filename ~ '^.*/(.+)$' ) { + add_header Content-Disposition 'attachment; filename="$1"'; + } # The media files mounted in the docker volume sendfile on;