diff --git a/nginx/nginx.conf b/nginx/nginx.conf index b1007698..7812b3e0 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -58,13 +58,12 @@ http { add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With'; - # This hack to add header Content-Disposition will be deleted if envvar THUMBOR_ALLOW_CONTENT_DISPOSITION != true - if ($args ~* download){ add_header 'Content-Disposition' 'attachment'; } - location ~* "^/(..)(..)(.+)?$" { root /data/result_storage/v2/$1/$2; expires 1M; error_page 404 = @fetch; + + if ($args ~* download){ add_header 'Content-Disposition' 'attachment'; } # This hack to add header Content-Disposition will be deleted if envvar THUMBOR_ALLOW_CONTENT_DISPOSITION != true } location = /healthcheck { @@ -75,6 +74,8 @@ http { location @fetch { internal; proxy_pass http://thumbor$request_uri; + + if ($args ~* download){ add_header 'Content-Disposition' 'attachment'; } # This hack to add header Content-Disposition will be deleted if envvar THUMBOR_ALLOW_CONTENT_DISPOSITION != true } location ~ /\.ht { deny all; access_log off; error_log off; }