HttpSecureLinkModule Q?

António P. P. Almeida appa at perusio.net
Wed Dec 22 15:45:07 MSK 2010


On 22 Dez 2010 06h56 WET, nbubingo at gmail.com wrote:

>
> And the configuration (have not tested yet):
>
> location /p/ {
> secure_link $arg_st,$arg_e; # this must match the URI part related 
> to the MD5 hash and expiration
> secure_link_md5 segredo$uri$arg_e; # this is how the MD5 hash is 
> built from a secret token and an URI
>
> ## If the hash is incorrect then $secure_link is a null string.
> if ($secure_link = "") {
> return 403;
> }
>
> ## The current local time is greater than the specified expiration
> ## time.
> if ($secure_link = "0") {
> return 403;
> }
>
> ## If everything is ok $secure_link is 1.
> ## This needs to be here otherwise you'll get a 404.
> rewrite ^/p/(.*)$ /p/$1 break;
> }

I just tested it. It works.

--- appa




More information about the nginx mailing list