Skip to content

Instantly share code, notes, and snippets.

@landys
Created March 21, 2015 06:59
Show Gist options
  • Save landys/cd3a5fdc769d576d578f to your computer and use it in GitHub Desktop.
Save landys/cd3a5fdc769d576d578f to your computer and use it in GitHub Desktop.
Setting header instead of adding header with proxy_pass and proxy_hide_header in Nginx
location ~ /dl/.*\.(jpg|png)$ {
proxy_pass http://test.51bmb.com;
proxy_hide_header Content-Type;
rewrite ^/(.*)/dl/(.*)$ /$1/$2 break;
root /mnt/data/bmbtest;
add_header Content-Type application/octet-stream;
add_header Content-Disposition "attachment;filename=qrcode.png";
expires 30d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment