NginxChsHttpSecureLinkModule
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 鏃堕棿鍊 銆