Created
September 16, 2013 07:47
nginx secure_link rails
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
# Downloads server | |
server { | |
listen 80; | |
server_name files.domain.com; | |
root /some/path/files.domain; | |
location /downloads { | |
secure_link $arg_md5,$arg_expires; | |
secure_link_md5 "$secure_link_expires$uri DOWNLOAD_SECRET"; | |
if ($secure_link = "") { | |
return 403; | |
} | |
if ($secure_link = "0") { | |
return 410; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment