# Nginx-0.7.18

**URL:** <https://www.ruby-forum.com/t/nginx-0-7-18/150805>\
**Category:** NGINX\
**Created:** [October 13, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805 "2008-10-13T15:34:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/1 "2008-10-13T15:34:28Z")

</div>

Changes with nginx 0.7.18 13 Oct  
2008

```
*) Change: the "underscores_in_headers" directive; now nginx does 

```

not  
allows underscores in a client request header line names.

```
*) Feature: the ngx_http_secure_link_module.

*) Feature: the "real_ip_header" directive supports any header.

*) Feature: the "log_subrequest" directive.

*) Feature: the $realpath_root variable.

*) Feature: the "http_502" and "http_504" parameters of the
   "proxy_next_upstream" directive.

*) Bugfix: the "http_503" parameter of the "proxy_next_upstream" or
   "fastcgi_next_upstream" directives did not work.

*) Bugfix: nginx might send a "Transfer-Encoding: chunked" heaer 

```

line  
for HEAD requests.

```
*) Bugfix: now accept threshold depends on worker_connections.
```

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 4:10pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/2 "2008-10-13T16:10:22Z")

</div>

Great!

2008/10/13 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 4:44pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/3 "2008-10-13T16:44:35Z")

</div>

Igor S. wrote:

> ```
> *) Feature: the ngx_http_secure_link_module.
> *) Feature: the "log_subrequest" directive.
> 
> ```

Any idea when we’ll have documentation on these new features?

–

_Phillip B Oldham_  
The Activity People  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) [mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

* * *

_Policies_

This e-mail and its attachments are intended for the above named  
recipient(s) only and may be confidential. If they have come to you in  
error, please reply to this e-mail and highlight the error. No action  
should be taken regarding content, nor must you copy or show them to  
anyone.

This e-mail has been created in the knowledge that Internet e-mail is  
not a 100% secure communications medium, and we have taken steps to  
ensure that this e-mail and attachments are free from any virus. We must  
advise that in keeping with good computing practice the recipient should  
ensure they are completely virus free, and that you understand and  
observe the lack of security when e-mailing us.

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 5:18pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/4 "2008-10-13T17:18:39Z")

</div>

Hi Igor,

I downloaded and installed the new version.

Headers are as follows:

HTTP/1.1 200 OK  
Server: nginx/0.7.19  
Date: Mon, 13 Oct 2008 15:04:49 GMT  
Content-Type: text/html  
Transfer-Encoding: chunked  
Connection: keep-alive  
Keep-Alive: timeout=20  
X-Powered-By: PHP/5.2.6  
Content-Encoding: gzip

I’m a little confused by the version.

Jim

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/5 "2008-10-13T17:04:33Z")

</div>

On Mon, Oct 13, 2008 at 03:36:05PM +0100, Phillip B Oldham wrote:

> Igor S. wrote:
> 
> > \*) Feature: the ngx\_http\_secure\_link\_module.  
> > \*) Feature: the “log\_subrequest” directive.
> 
> Any idea when we’ll have documentation on these new features?

The “log\_subrequest on|off” allows to log subrequests in access\_log.

The ngx\_http\_secure\_link\_module allows to create a secure link as  
/prefix/hash/link, where

1. prefix is any symbols expect “/”;
2. hash is md5(link, secret),  
the secret is set by secure\_link\_secret directive;
3. and link is some link to secure.

Example:

```
 location /p/ {
     secure_link_secret some_secret;

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

```

The $secure\_link variable is equal to a link if a hash is valid,  
otherwise it is “”.

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 5:29pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/6 "2008-10-13T17:29:15Z")

</div>

On Mon, Oct 13, 2008 at 11:09:49AM -0400, Jim O. wrote:

> Transfer-Encoding: chunked  
> Connection: keep-alive  
> Keep-Alive: timeout=20  
> X-Powered-By: PHP/5.2.6  
> Content-Encoding: gzip
> 
> I’m a little confused by the version.

Sorry, this is my second error for today.  
First I’ve uploaded old 0.7.18 tarball, then I’ve uploaded modern 0.7.18  
with incremented version. I’ve just released correct 0.7.19 tarball.

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/7 "2008-10-13T18:06:17Z")

</div>

Igor S. wrote:

> The ngx\_http\_secure\_link\_module allows to create a secure link as  
> /prefix/hash/link, where
> 
> 1. prefix is any symbols expect “/”;
> 2. hash is md5(link, secret),  
> the secret is set by secure\_link\_secret directive;
> 3. and link is some link to secure.

lighttpd has a similar feature with an additional possibility to specify  
a timeout: [Docs ModSecDownload - Lighttpd - lighty labs](http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSecDownload)

The timeout would be a nice addition to nginx, because otherwise once  
someone has received the “secure link” he can pass it around to other  
people and it will never expire.

Steffen

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/8 "2008-10-13T18:25:40Z")

</div>

> Igor S. wrote:
> 
> > The ngx\_http\_secure\_link\_module allows to create a secure  
> > link as..

[…]

> lighttpd has a similar feature with an additional  
> possibility to specify  
> a timeout:  
> [http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSecDownloa](http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSecDownloa)  
> d

I was just wondering is this similar to lighty’s mod\_secdownload.  
I used this feature on one of my site so I definitely will test  
this feature soon. Perhaps next week.

> The timeout would be a nice addition to nginx, because  
> otherwise once  
> someone has received the “secure link” he can pass it around  
> to other  
> people and it will never expire.

Spot on. Combination of both options allow dynamically generated  
link that expires at a predetermined interval. I second this  
feature.

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/9 "2008-10-13T20:39:41Z")

</div>

Igor S. wrote:

> The unique links should be created using X-Accel-Redirect, however,  
> I will probably add timestamps.

Using X-Accel-Redirect requires that either a) you do not have a  
dedicated download-server in addition to your webserver or b) your  
download-server has access to your (user) database.

The nice thing about a timeout value like in lighttpd’s mod\_secdownload  
is that your download-server does not even need a connection to your  
database and therefore can be located anywhere you can imagine: You just  
let an application running on your webserver create a secret link and  
your lighttpd-download-server can validate this request completely on  
its own.

So: Yes, a timeout value would be useful. 🙂

Steffen

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 7:03am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/10 "2008-10-14T07:03:25Z")

</div>

I have set a secure link:  
location /dl/  
{  
secure\_link\_secret lhm;  
if ($secure\_link == “”) {  
return 503;  
}  
}

Then  
md5(dllhm)=91fe55efd557140f7a32f7f7c1c74aa3

Then access it through  
[http://host/91fe55efd557140f7a32f7f7c1c74aa3/dl/,but](http://host/91fe55efd557140f7a32f7f7c1c74aa3/dl/,but) get a 404.

Any thing wrong?

2008/10/13 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 13, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/11 "2008-10-13T19:21:29Z")

</div>

On Mon, Oct 13, 2008 at 05:56:47PM +0200, Steffen W. wrote:

> a timeout: [Docs ModSecDownload - Lighttpd - lighty labs](http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSecDownload)
> 
> The timeout would be a nice addition to nginx, because otherwise once  
> someone has received the “secure link” he can pass it around to other  
> people and it will never expire.

The current use of the module is not to create unique expiring links,  
but to validate redirecting or proxying URLs such as

[http://www.example.com/click/XXXXX/frod.site.com/foobar/](http://www.example.com/click/XXXXX/frod.site.com/foobar/)

The unique links should be created using X-Accel-Redirect, however,  
I will probably add timestamps.

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 10:19am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/12 "2008-10-14T10:19:27Z")

</div>

Also not right.  
I can not get the right thing.  
Can you give me an example?

2008/10/14 Anton Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 10:38am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/13 "2008-10-14T10:38:49Z")

</div>

On Tue, Oct 14, 2008 at 04:10:58PM +0800, lhmwzy wrote:

> Also not right.  
> I can not get the right thing.  
> Can you give me an example?

You also need a “rewrite” to replace an URL with a link itself only:

location /dl/  
secure\_link\_secret lhm;  
if ($secure\_link = “”) {  
return 403;  
}  
}

```
 root /path/to/files;

 rewrite ^ $secure_link break;

```

}

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 10:52am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/14 "2008-10-14T10:52:53Z")

</div>

Still not ok…  
I am confused…

2008/10/14 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 9:29am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/15 "2008-10-14T09:29:18Z")

</div>

On 14.10.2008 08:53, lhmwzy wrote:

> Then  
> md5(dllhm)=91fe55efd557140f7a32f7f7c1c74aa3
> 
> Then access it through  
> [http://host/91fe55efd557140f7a32f7f7c1c74aa3/dl/,but](http://host/91fe55efd557140f7a32f7f7c1c74aa3/dl/,but) get a 404.

URL should be under location /d1/ e. g.

[http://host/d1/7a701b100383d50fc2995ed264add62a/some\_url\_to\_protected\_resource](http://host/d1/7a701b100383d50fc2995ed264add62a/some_url_to_protected_resource)

$ echo -n some\_url\_to\_protected\_resourcelhm | md5  
7a701b100383d50fc2995ed264add62a

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 11:11am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/16 "2008-10-14T11:11:06Z")

</div>

On Tue, Oct 14, 2008 at 12:57:36PM +0400, Igor S. wrote:

> On Tue, Oct 14, 2008 at 04:40:29PM +0800, lhmwzy wrote:
> 
> > Still not ok…  
> > I am confused…

- rewrite ^ $secure\_link break;

- rewrite ^ /$secure\_link break;

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 11:23am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/17 "2008-10-14T11:23:27Z")

</div>

OK.  
Here is my config:  
…  
location /dll/  
{  
secure\_link\_secret lhm;  
if ($secure\_link = “”) {  
return 403;  
}  
rewrite ^ /$secure\_link break;  
}  
…

Then request a directory under dll  
/dll/dl/

md5(dllhm)=91fe55efd557140f7a32f7f7c1c74aa3

use “[http://host/dll/91fe55efd557140f7a32f7f7c1c74aa3/dl](http://host/dll/91fe55efd557140f7a32f7f7c1c74aa3/dl)” to  
request,right?

Then get “403 Forbidden”

Any thing is wrong?

2008/10/14 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 11:09am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/18 "2008-10-14T11:09:55Z")

</div>

On Tue, Oct 14, 2008 at 04:40:29PM +0800, lhmwzy wrote:

> Still not ok…  
> I am confused…

What do you get 404 or 403 ?  
If the former, what in your error\_log ?

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 11:44am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/19 "2008-10-14T11:44:04Z")

</div>

On Tue, Oct 14, 2008 at 05:13:31PM +0800, lhmwzy wrote:

> ```
> }
> 
> ```
> 
> Any thing is wrong?

Do you have index file in /dll/dl/ ? Or autoindex enabled ?

---

<div class="post-metadata">

**Author:** ![imixaly4](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3ab097/32.png) [@imixaly4](https://www.ruby-forum.com/u/imixaly4)\
**Post date:** [October 14, 2008, 11:26am UTC](https://www.ruby-forum.com/t/nginx-0-7-18/150805/20 "2008-10-14T11:26:59Z")

</div>

My configure parameter:

–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\_secure\_link\_module  
–with-http\_realip\_module --with-poll\_module

2008/10/14 lhmwzy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

[Next page](https://www.ruby-forum.com/t/nginx-0-7-18/150805.md?page=2)
