Created
March 21, 2015 06:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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