From c6e298448af8c8a5003747a9adca9294fbc18dd9 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 12 Dec 2022 13:41:44 -0700 Subject: [PATCH] Including filename in nginx response for media. --- nginx.conf | 3 +++ nginx.dev.conf | 3 +++ 2 files changed, 6 insertions(+) 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;