FAQ

Page Discussion Edit History

NginxChsHttpSecureLinkModule

Revision as of 08:57, 11 October 2010 by Uingei (Talk)

(diff) 鈫 Older revision | Latest revision (diff) | Newer revision 鈫 (diff)

Contents

[edit] 鎬昏堪

姝ゆā鍧楄绠楀拰妫鏌ヨ姹傛墍闇鐨勫畨鍏ㄩ摼鎺ョ綉鍧銆 姝ゆā鍧楅粯璁ゆ儏鍐典笅涓嶄細琚紪璇戝惎鐢紝瑕佸惎鐢ㄥ畠璇蜂娇鐢ㄦ寚浠

--with-http_secure_link_module

鍙備笌缂栬瘧瀹夎 nginx 銆傛敞鎰忥細姝ゆā鍧椾粎鍦 nginx 鐗堟湰涓0.7.18鎴栨洿楂樻椂鎵嶈鏀寔銆

[edit] 閰嶇疆瀹炰緥:

        location /p/ {
            location ~ ^/p/(?<secure>[\w\-=]+,\d+)(?<file>/.+)$ {
 
                secure_link          $secure;
                secure_link_md5      $secure_link_expires.$file.PASSWORD;
 
                if ($secure_link = "") {
                    return 403;
                }
 
                if ($secure_link == 0) {
                    return 410;
                }
 
                alias  /path/to$file;
            }
 
            return 404;
 
            error_page  403       /forbidden.html;
            error_page  404       /not_found.html;
            error_page  410  =403 /link_expired.html;
        }

[edit] 鍙橀噺

[edit] $secure_link

鍙橀噺 $secure_link 鏈夊涓嬪:

"" - 涓嶆纭殑閾炬帴 "0" - 杩囨湡閾炬帴 "1" - 姝g‘閾炬帴

[edit] $secure_link_expires

鍙橀噺 $secure_link_expires 鏃堕棿鍊 銆