Nginx-0.7.18

I think the $secure_link is not right.
when change

            if ($secure_link = "") {
                          return 403;
           }

to

            if ($secure_link = "") {
                          return 500;
           }

then the error is always 500 error.
Thus we can say the $secure_link=“”?

2008/10/14 lhmwzy [email protected]:

Yes,I put a index.html file in dl directory.

2008/10/14 Igor S. [email protected]:

Any body try “ngx_http_secure_link_module” and successful?
Please give me a hint.

2008/10/14 lhmwzy [email protected]:

Still can not configure “ngx_http_secure_link_module” successfully…

2008/10/15 lhmwzy [email protected]:

On Wed, Oct 15, 2008 at 09:21:55PM +0800, lhmwzy wrote:

Still can not configure “ngx_http_secure_link_module” successfully…

The module did not work if link was less than 3 symbols (“dl”).
The attached patch should fix the bug.

OK.
The dir structure is:
wwwroot/dll/dl/index.html

the www root is wwwroot.
I put the following to nginx.conf

server {


location /dll/
{
secure_link_secret some;

         if ($secure_link = "") {
             return 500;
       }
    }


}

Then I request through
http://host/dll/cb691d768d21d59719ef7ed3b2ecaf4e/dl
Also get a 500 error page.

md5(somedl)=cb691d768d21d59719ef7ed3b2ecaf4e

2008/10/21 Igor S. [email protected]:

YES.I have tried the patch through.
But I think there must be something wrong.
Here is my configure:

./configure --user=www --group=www --prefix=/usr/local/nginx
–with-http_stub_status_module --with-http_ssl_module --with-md5=/usr
–with-http_gzip_static_module --with-http_realip_module
–with-poll_module --with-http_secure_link_module

2008/10/21 Igor S. [email protected]:

On Tue, Oct 21, 2008 at 09:11:44PM +0800, lhmwzy wrote:

YES.I have tried the patch through.
But I think there must be something wrong.
Here is my configure:

./configure --user=www --group=www --prefix=/usr/local/nginx
–with-http_stub_status_module --with-http_ssl_module --with-md5=/usr
–with-http_gzip_static_module --with-http_realip_module
–with-poll_module --with-http_secure_link_module

Have you tried

/dll/3373757a24a035b9d157d97468401a19/dl/index.html

?

On Tue, Oct 21, 2008 at 08:58:57PM +0800, lhmwzy wrote:

    location /dll/

Then I request through
http://host/dll/cb691d768d21d59719ef7ed3b2ecaf4e/dl
Also get a 500 error page.

md5(somedl)=cb691d768d21d59719ef7ed3b2ecaf4e

Have you tried the attached patch ?

BTW, /dll/3373757a24a035b9d157d97468401a19/dl/index.html
should work without patch.

I tried:

/dll/3373757a24a035b9d157d97468401a19/dl/index.html

also get a 500 error page.

Also a 500 error page.

2008/10/21 Igor S. [email protected]:

On Tue, Oct 21, 2008 at 08:58:57PM +0800, lhmwzy wrote:

    location /dll/

Then I request through
http://host/dll/cb691d768d21d59719ef7ed3b2ecaf4e/dl
Also get a 500 error page.

md5(somedl)=cb691d768d21d59719ef7ed3b2ecaf4e

You should use
md5(dlsome) = 1f5239a316bd9ee50d2bce5cfa011ed0

Here is my page:
http://www.dydoor.net/dll/1f5239a316bd9ee50d2bce5cfa011ed0/index.html

2008/10/21 lhmwzy [email protected]:

Sorry,the page should be

http://www.dydoor.net/dll/1f5239a316bd9ee50d2bce5cfa011ed0/dl/index.html

2008/10/21 lhmwzy [email protected]:

On Tue, Oct 21, 2008 at 10:01:48PM +0800, lhmwzy wrote:

Also a 500 error page.

/dll/d66423000cfdc233b5517b582babb46e/dl/index.html

?

/dll/d66423000cfdc233b5517b582babb46e/dl/index.html
get a 404 error.

/dll/d66423000cfdc233b5517b582babb46e/dl/
get a 500 error.

I’m sure there is a file named index.html in dll/dl/.

2008/10/21 Igor S. [email protected]:

On Tue, Oct 21, 2008 at 10:12:59PM +0800, lhmwzy wrote:

/dll/d66423000cfdc233b5517b582babb46e/dl/index.html
get a 404 error.

/dll/d66423000cfdc233b5517b582babb46e/dl/
get a 500 error.

I’m sure there is a file named index.html in dll/dl/.

What is in error_log ?

On Tue, Oct 21, 2008 at 10:08:32PM +0800, lhmwzy wrote:

Sorry,the page should be

http://www.dydoor.net/dll/1f5239a316bd9ee50d2bce5cfa011ed0/dl/index.html

No, page should be

http://www.dydoor.net/dll/d66423000cfdc233b5517b582babb46e/dl/index.html

as MD5 (“dl/index.htmlsome”) = d66423000cfdc233b5517b582babb46e

and it seems to work (404).

On Tue, Oct 21, 2008 at 10:12:59PM +0800, lhmwzy wrote:

/dll/d66423000cfdc233b5517b582babb46e/dl/index.html
get a 404 error.

/dll/d66423000cfdc233b5517b582babb46e/dl/
get a 500 error.

I’m sure there is a file named index.html in dll/dl/.

Probably you missed

 rewrite  ^   /$secure_link  break;

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)?

2008/10/21 Igor S. [email protected]: