Nginx-0.7.44

Changes with nginx 0.7.44 23 Mar
2009

*) Feature: the ngx_http_proxy_module preliminary cache support.

*) Feature: the --with-pcre option in the configure.

*) Feature: the "try_files" directive is now allowed on the server
   block level.

*) Bugfix: the "try_files" directive handled incorrectly a query 

string
in a fallback parameter.

*) Bugfix: the "try_files" directive might test incorrectly 

directories.

*) Bugfix: if there is the single server for given address:port 

pair,
then captures in regular expressions in a “server_name” directive
did not work.

Good work!

2009/3/23 Igor S. [email protected]:

Nginx 0.7.44 for Windows is available for free download here:
http://cli.gs/744

Kevin W.

2009/3/23 Igor S. [email protected]:

2009/3/23 Igor S. [email protected]:

  in a fallback parameter.

*) Bugfix: the “try_files” directive might test incorrectly directories.

*) Bugfix: if there is the single server for given address:port pair,
then captures in regular expressions in a “server_name” directive
did not work.

Hi Igor,

I have problems compiling this last version:

In file included from src/http/ngx_http_file_cache.c:10:
src/core/ngx_md5.h:18:17: md5.h: No such file or directory
In file included from src/http/ngx_http_file_cache.c:10:
src/core/ngx_md5.h:22: error: syntax error before “ngx_md5_t”
src/core/ngx_md5.h:22: warning: type defaults to int' in declaration of ngx_md5_t’
src/core/ngx_md5.h:22: warning: data definition has no type or storage
class
src/http/ngx_http_file_cache.c: In function
ngx_http_file_cache_create_key': src/http/ngx_http_file_cache.c:94: error: syntax error before "md5" src/http/ngx_http_file_cache.c:102: warning: implicit declaration of function MD5Init’
src/http/ngx_http_file_cache.c:102: error: md5' undeclared (first use in this function) src/http/ngx_http_file_cache.c:102: error: (Each undeclared identifier is reported only once src/http/ngx_http_file_cache.c:102: error: for each function it appears in.) src/http/ngx_http_file_cache.c:112: warning: implicit declaration of function MD5Update’
src/http/ngx_http_file_cache.c:119: warning: implicit declaration of
function MD5Final' make[1]: *** [objs/src/http/ngx_http_file_cache.o] Error 1 make[1]: Leaving directory /misc/distrib/BUILD/nginx-0.7.44’
make: *** [build] Error 2

I’m not using openssl and I don’t have any md5.h file in my include
path. /usr/include/md5.h is valid on BSD but not on Linux. I have to
add the openssl library somehow in configure. I think there is a
missing check in the configure script.

The build is working correctly if I’m using
–openssl-dir=/usr/local/openssl-0.9.6.

++ Jerome

Le 23 mars 2009 15:37, Jérôme Loyet [email protected] a écrit :

*) Bugfix: the “try_files” directive handled incorrectly a query string

src/http/ngx_http_file_cache.c:94: error: syntax error before “md5”
function `MD5Final’
–openssl-dir=/usr/local/openssl-0.9.6.
Sorry I miss something: The build is working correctly if I’m using
–openssl-dir=/usr/local/openssl-0.9.6 AND --with-http_ssl_module
(only openssl-dir show that it founds the library but it doesn’t use
it when compiling (no -I /usr/local/openssl-0.9.6/include))

How to use the cache feature?
What kind of cache does it support?

2009/3/23 Igor S. [email protected]

On Mon, Mar 23, 2009 at 03:41:51PM +0100, J?r?me Loyet wrote:

(only openssl-dir show that it founds the library but it doesn’t use
it when compiling (no -I /usr/local/openssl-0.9.6/include))

nginx’s configure has no --openssl-dir= option.

2009/3/23 Igor S. [email protected]:

Sorry I miss something: The build is working correctly if I’m using
–openssl-dir=/usr/local/openssl-0.9.6 AND --with-http_ssl_module
(only openssl-dir show that it founds the library but it doesn’t use
it when compiling (no -I /usr/local/openssl-0.9.6/include))

nginx’s configure has no --openssl-dir= option.

I meant --with-openssl= option. Sorry

On Mon, Mar 23, 2009 at 10:42:45PM +0800, Delta Y. wrote:

How to use the cache feature?
What kind of cache does it support?

Here is configuraiton example:

http {
proxy_cache_path /path/to/cache levels=1:2
keys_zone=NAME:10m
inactive=5m clean_time=2h00m;

 server {
     location / {
         proxy_pass    http://127.0.0.1;

         proxy_cache   NAME;

         proxy_cache_valid   200 302  1h;
         proxy_cache_valid   301      1d;
         proxy_cache_valid   any      1m;

         proxy_cache_min_uses  1;

         proxy_cache_use_stale   error  timeout invalid_header 

http_500;
}
}

The cache currently ignores backend’s Cache-Control, Expires, etc.

On Mon, Mar 23, 2009 at 03:55:54PM +0100, J?r?me Loyet wrote:

Sorry I miss something: The build is working correctly if I’m using
–openssl-dir=/usr/local/openssl-0.9.6 AND --with-http_ssl_module
(only openssl-dir show that it founds the library but it doesn’t use
it when compiling (no -I /usr/local/openssl-0.9.6/include))

nginx’s configure has no --openssl-dir= option.

I meant --with-openssl= option. Sorry

The --with-openssl= option should point to OpenSSL sources, but not
to inlcudes and binary libraries.

2009/3/23 Igor S. [email protected]:

The build is working correctly if I’m using

The --with-openssl= option should point to OpenSSL sources, but not
to inlcudes and binary libraries.

OK thx for the answer.

On Mon, Mar 23, 2009 at 04:06:32PM +0100, J?r?me Loyet wrote:

I meant --with-openssl= option. Sorry

The --with-openssl= option should point to OpenSSL sources, but not
to inlcudes and binary libraries.

OK thx for the answer.

As your OpenSSL is set in non-standard place (I have just tested
building
on Debian with standard /usr/include/openssl/md5.h), you should use
something like this:

–with-cc-opt=-I/usr/local/openssl-0.9.6/include

On Mon, Mar 23, 2009 at 04:27:53PM +0100, J?r?me Loyet wrote:

path. /usr/include/md5.h is valid on BSD but not on Linux. I have to

on Debian with standard /usr/include/openssl/md5.h), you should use
#endif

Has NGX_HAVE_OPENSSL_MD5_H is not defined, it looks for md5.h instead
of openssl/md5.h. And if I use
–with-cc-opt=-I/usr/local/openssl-0.9.6/include/openssl it won’t work
because the function name are from OpenSSL lib and not from BSD kernel
(MD5_Init vs MD5Init).

I have to make configure to set NGX_HAVE_OPENSSL_MD5_H … do you have
any clue ? I’m still searching

  • –with-cc-opt=-I/usr/local/openssl-0.9.6/include/openssl
  • –with-cc-opt=-I/usr/local/openssl-0.9.6/include

Hi Igor,

 proxy_cache_path   /path/to/cache  levels=1:2
                    keys_zone=NAME:10m
                    inactive=5m     clean_time=2h00m;

 server {
     location / {
         proxy_pass    http://127.0.0.1;

Can we use the $scheme, instead http?

Thanks for the release.

Floren

2009/3/23 Igor S. [email protected]:

add the openssl library somehow in configure. I think there is a
nginx’s configure has no --openssl-dir= option.
something like this:

–with-cc-opt=-I/usr/local/openssl-0.9.6/include

it’s not working because of the #ifdef in md5.h:

#if (NGX_HAVE_OPENSSL_MD5_H)
#include <openssl/md5.h>
#else
#include <md5.h>
#endif

Has NGX_HAVE_OPENSSL_MD5_H is not defined, it looks for md5.h instead
of openssl/md5.h. And if I use
–with-cc-opt=-I/usr/local/openssl-0.9.6/include/openssl it won’t work
because the function name are from OpenSSL lib and not from BSD kernel
(MD5_Init vs MD5Init).

I have to make configure to set NGX_HAVE_OPENSSL_MD5_H … do you have
any clue ? I’m still searching

thx a lot

2009/3/23 Igor S. [email protected]:

(only openssl-dir show that it founds the library but it doesn’t use

#else
any clue ? I’m still searching

  • –with-cc-opt=-I/usr/local/openssl-0.9.6/include/openssl
  • –with-cc-opt=-I/usr/local/openssl-0.9.6/include

Here are configuration options:
./configure --with-http_addition_module --with-http_flv_module
–with-http_gzip_static_module --with-http_realip_module
–with-http_stub_status_module --with-http_sub_module
–with-cc-opt=-I/usr/local/openssl-0.9.6/include

And a part of the output:
[…]
checking for rsaref md5 library … not found
checking for rsaref md library … not found
checking for OpenSSL md5 crypto library … not found
[…]
Configuration summary

  • using system PCRE library
  • OpenSSL library is not used
  • md5 library is not found
  • sha1 library is not used
  • using system zlib library

as OpenSSL md5 crypto library is not found, NGX_HAVE_OPENSSL_MD5_H is
not defined by configure. So ngx_md5.h will try to include <md5.h> and
not <openssl/md5.h>

#if (NGX_HAVE_OPENSSL_MD5_H)
#include <openssl/md5.h>
#else
#include <md5.h>
#endif

And make stops at compilation time when including ngx_md5.h from
ngx_http_file_cache.c

How to tell to configure script to lookup in /usr/local/openssl-0.9.6
for headers and lib from openssl ?

On Mon, Mar 23, 2009 at 11:55:09AM -0400, Floren M. wrote:

 proxy_cache_path   /path/to/cache  levels=1:2
                    keys_zone=NAME:10m
                    inactive=5m     clean_time=2h00m;

 server {
     location / {
         proxy_pass    http://127.0.0.1;

Can we use the $scheme, instead http?

You can, however, I do not understand how this relates to the caching.

On Mon, Mar 23, 2009 at 05:03:40PM +0100, J?r?me Loyet wrote:

On Mon, Mar 23, 2009 at 03:41:51PM +0100, J?r?me Loyet wrote:

–openssl-dir=/usr/local/openssl-0.9.6 AND --with-http_ssl_module
OK thx for the answer.
#include <openssl/md5.h>
I have to make configure to set NGX_HAVE_OPENSSL_MD5_H … do you have

  • sha1 library is not used
  • using system zlib library

What is in objs/autoconf.err under the line:
checking for OpenSSL md5 crypto library
?

And make stops at compilation time when including ngx_md5.h from
ngx_http_file_cache.c

How to tell to configure script to lookup in /usr/local/openssl-0.9.6
for headers and lib from openssl ?

This may be not include problem, but library’s one.
Where is md5.h and libcrypto.so on your system:

/usr/local/openssl-0.9.6/include/openssl/md5.h
/usr/local/openssl-0.9.6/lib/libcrypto.so

?

Floren M. wrote:

         proxy_pass    http://127.0.0.1;

Can we use the $scheme, instead http?

Thanks for the release.

Why you want to use https:// between frontend and backend (which usually
connected via trusted
network where encryption is unnecessary).

Hi Anton,

network where encryption is unnecessary).
Thanks for the clarification, I am not familiar with proxies.

Regards,

Floren