Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
add-header with if necessary inside location
Browse files Browse the repository at this point in the history
  • Loading branch information
psyduck787 committed Nov 21, 2016
1 parent dcd38c3 commit 7a26c08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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; }
Expand Down

0 comments on commit 7a26c08

Please sign in to comment.