Created
February 20, 2019 17:41
-
-
Save D4R4/488318e68a2272874c4d5737f53be9b0 to your computer and use it in GitHub Desktop.
Tell nginx to treat mp3 mp4 and any media extention as attachment and go straight to download instead of browser player
This file contains hidden or 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 ~ ^.*/(?P<request_basename>[^/]+\.(mp4))$ { | |
add_header Content-Disposition 'attachment; filename="$request_basename"'; | |
} | |
location ~ ^.*/(?P<request_basename>[^/]+\.(mp3))$ { | |
add_header Content-Disposition 'attachment; filename="$request_basename"'; | |
} | |
location ~ ^.*/(?P<request_basename>[^/]+\.(ogg))$ { | |
add_header Content-Disposition 'attachment; filename="$request_basename"'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment