Skip to content

Instantly share code, notes, and snippets.

@smathy
Created May 6, 2015 23:43
Show Gist options
  • Save smathy/3baca8b9bea02d8bdfe4 to your computer and use it in GitHub Desktop.
Save smathy/3baca8b9bea02d8bdfe4 to your computer and use it in GitHub Desktop.
location ~* ^/convenient_url/(.+)$ {
internal;
set $host_name some.secret.cdn.hostname.com;
set $content_ip 10.11.12.13;
set $content_url http://$content_ip/$1;
proxy_set_header Host $host_name;
add_header Content-Type 'application/octet-stream';
proxy_hide_header Content-Disposition;
add_header Content-Disposition 'attachment; filename="$1"';
proxy_max_temp_file_size 0;
proxy_pass $content_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment