ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HttpAccessKeyModule или HttpSecureLinkModule



On 04.07.2013 13:21, Андрей Урядов wrote:

set $fileName '';
set $secretKey '';
if ($request_uri ~* ^/path_to_files/([0-9a-z]+)/(.+)$) {
         set $fileName $2;
         set $secretKey $1;
}
set $rightKey 0;
if (-f /path_to_download_keys/download_key/$remote_addr-$secretKey) {
       set $rightKey 1;
       rewrite ^(.*)$ /path_to_files/$fileName break;
}
if ( $rightKey != 1) {
       return 404;
}

http://nginx.org/ru/docs/http/ngx_http_secure_link_module.html

--
Best regards,
 Gena

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.