OK.Finally I get it.
Put “rewrite ^ /dll/$secure_link break;” to the secure_link block;
But I have a question:
The hash must be md5(link/file,secret).
When the file changes,the hash should also change.
Can nginx make the hash to md5(link,secret)?then only the directory
name is the key to hash,not include the name of files under the
directory.
For example:
In my example,when access /dll/dl/,use the hash md5(dl,secret),not
md5(dl/file,secret).
2008/10/21 Igor S. [email protected]:
On Tue, Oct 21, 2008 at 10:19:37PM +0800, lhmwzy wrote:
But it should display the content of index.html,not a 404 page.
So we should use a hash like md5(link/file, secret),not md5(link, secret)?
The secure link is
/prefix/hash/any/thing/here
hash = md5(any/thing/heresecret)
or can add a directive to do this.
Only a suggestion.
2008/10/21 lhmwzy [email protected]:
*) Feature: the ngx_http_secure_link_module.
Is it possible to proxy the request?
I’d like to do something like this:
location /dl/
secure_link_secret lhm;
if ($secure_link = “”) {
return 403;
}
}
proxy_pass http://192.168.0.10:3000;
rewrite ^ $secure_link break;
On Mon, Nov 10, 2008 at 03:59:31PM +0100, Thomas wrote:
}
}
proxy_pass http://192.168.0.10:3000;
rewrite ^ $secure_link break;
–
Yes, you may use something like this:
proxy_pass http://192.168.0.10:3000/$secure_link;
I tried to play with
but when I launch nginx I get the following error message:
[emerg] 27797#0: unknown directive “secure_link_secret” in
/usr/local/nginx/conf/website.conf
Here is my configuration file excerpt:
location /secret/ {
secure_link_secret some_secret;
if ($secure_link = "") {
return 403;
}
rewrite ^ /$secure_link break;
proxy_pass http://website/$secure_link;
}
Here is my configure:
./configure --with-http_ssl_module --with-http_gzip_static_module
–with-http_secure_link_module --with-poll_module
–with-pcre=…/pcre-7.8 --with-http_flv_module
–sbin-path=/usr/sbin/nginx --prefix=/usr/local/nginx
–add-module=…/nginx_mp4_streaming_lite --with-cc-opt=’-O3’
Moreover I don’t understand the following:
- hash is md5(link, secret),
the secret is set by secure_link_secret directive;
–
What is this secret thing? md5 cannot be decoded, so does this mean
that I have to hard code all my secret links inside Nginx’
configuration file?
On Tue, Oct 21, 2008 at 10:34:55PM +0800, lhmwzy wrote:
md5(dl/file,secret).
No, the sense is to protect awhole link.
Damn’ it! I’m having troubles with my $path or what? Istarted nginx by
specifying the full paht, i.e: /usr/sbin/nginx, and now the correct
nginx started with the module compiled and I didn’t have any error
messages.
I now have to understand how the secure_link_module works.