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
For example:
In my example,when access /dll/dl/,use the hash md5(dl,secret),not

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


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;


rewrite  ^   $secure_link  break;

On Mon, Nov 10, 2008 at 03:59:31PM +0100, Thomas wrote:



rewrite  ^   $secure_link  break;

Yes, you may use something like this:


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

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:

  1. 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:

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

I now have to understand how the secure_link_module works.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs