You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-15Lines changed: 22 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,33 @@
1
1
Nginx HMAC Secure Link Module
2
-
--
2
+
=============================
3
3
4
4
Description:
5
-
--
5
+
============
6
6
7
7
The Nginx HMAC secure link module enhances the security and functionality of the standard secure link module.
8
8
Secure token is created using secure HMAC construction with an arbitrary hash algorithm supported by OpenSSL, e.g., `md5`, `sha1`, `sha256`, `sha512`. Furthermore, secure token is created as described in RFC2104, that is, `H(secret_key XOR opad,H(secret_key XOR ipad, message))` instead of a simple `MD5(secret_key,message, expire)`.
9
9
10
10
Installation:
11
-
--
11
+
=============
12
12
13
13
You'll need to re-compile Nginx from source to include this module.
14
14
Modify your compile of Nginx by adding the following directive (modified to suit your path of course):
Message to be hashed is defined by `secure_link_hmac_message`, `secret_key` is given by `secure_link_hmac_secret`, and hashing algorithm H is defined by `secure_link_hmac_algorithm`.
33
33
@@ -40,7 +40,7 @@ Configuration example for server side.
40
40
```nginx
41
41
location ^~ /files/ {
42
42
# Variable to be passed are secure token, timestamp, expiration period (optional)
43
-
secure_link $arg_st,$arg_ts,$arg_e;
43
+
secure_link_hmac $arg_st,$arg_ts,$arg_e;
44
44
45
45
# Secret key
46
46
secure_link_hmac_secret my_secret_key;
@@ -51,13 +51,13 @@ location ^~ /files/ {
51
51
# Cryptographic hash function to be used
52
52
secure_link_hmac_algorithm sha256;
53
53
54
-
# If the hash is incorrect then $secure_link is a null string.
55
-
# If the hash is correct but the link has already expired then $secure_link is zero.
56
-
# If the hash is correct and the link has not expired then $secure_link is one.
54
+
# If the hash is incorrect then $secure_link_hmac is a null string.
55
+
# If the hash is correct but the link has already expired then $secure_link_hmac is zero.
56
+
# If the hash is correct and the link has not expired then $secure_link_hmac is one.
57
57
58
58
# In production environment, we should not reveal to potential attacker
It is also possible to use this module with a Nginx acting as proxy server.
110
110
111
-
The string to be signed is defined in `secure_link_hmac_message`, the `secure_link_token` variable contains then a secure token to be passed to backend server.
111
+
The string to be signed is defined in `secure_link_hmac_message`, the `secure_link_hmac_token` variable contains then a secure token to be passed to backend server.
0 commit comments