Nginx-0.8.21

Changes with nginx 0.8.21 26 Oct
2009

*) Feature: now the "-V" switch shows TLS SNI support.

*) Feature: the "listen" directive of the HTTP module supports unix
   domain sockets.
   Thanks to Hongli L..

*) Feature: the "default_server" parameter of the "listen" 

directive.

*) Feature: now a "default" parameter is not required to set listen
   socket options.

*) Bugfix: nginx did not support dates in 2038 year on 32-bit 

platforms;

*) Bugfix: socket leak; the bug had appeared in 0.8.11.

Thanks a lot.

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 17:16:18 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: nginx-0.8.21

How is that supposed to work? Should something like that here set that
server to be the default if no match is found for the host requested?

server {
listen 80 default_server;
}

On Mon, Oct 26, 2009 at 04:49:30PM +0100, Steve wrote:

*) Feature: now the "-V" switch shows TLS SNI support.

listen 80 default_server;
}

Yes, this parameter sets default server for given listen pair, “*:80” in
this case. Actullay, “default_server” is just alias to a “default”. I’ve
introduced this name, because people treats the “default” parameter in

listen 80 default backlog=1000 …;

as related to backlog, etc., although it means just default server for
given listen pair.

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 19:02:47 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.21

Oct
directive.
this case. Actullay, “default_server” is just alias to a “default”. I’ve
introduced this name, because people treats the “default” parameter in

listen 80 default backlog=1000 …;

as related to backlog, etc., although it means just default server for
given listen pair.

Does not work over here. I get a error in Firefox telling me something
about the page not being correctly redirected.

On Mon, Oct 26, 2009 at 05:41:31PM +0100, Steve wrote:

-------- Original-Nachricht --------


as related to backlog, etc., although it means just default server for
given listen pair.

Does not work over here. I get a error in Firefox telling me something about the page not being correctly redirected.

Could you create debug log ?

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 19:47:10 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.21

2009

in
about the page not being correctly redirected.

Could you create debug log ?

How?

On Mon, Oct 26, 2009 at 06:04:34PM +0100, Steve wrote:

in
about the page not being correctly redirected.

Could you create debug log ?

How?

./configure --with-debug …

nginx.conf:

error_log /path/to/log debug;

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 20:18:25 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.21

}

Could you create debug log ?

How?

./configure --with-debug …

nginx.conf:

error_log /path/to/log debug;

2009/10/26 16:36:12 [emerg] 31458#0: host not found in “default_server”
of the “listen” directive in
/var/www/hosting/vhosts.conf.d/front/2000_domain.tld.conf:5

What host does nginx have issue to find?

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 20:57:56 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.21


listen 80 default backlog=1000 …;
Could you create debug log ?
of the “listen” directive in
/var/www/hosting/vhosts.conf.d/front/2000_domain.tld.conf:5

What host does nginx have issue to find?

Could you show the 5th line of the 2000_domain.tld.conf ?

1 server {
2 #====================================================
3 set $vhost “domain.tld”;
4 set $vhost_root “/var/www/vu-hosting/$vhost”;
5 listen 80 default_server;
6 server_name www.domain.tld .domain.tld;
7 access_log /var/www/vu-hosting/domain.tld/logs/access_log
combined;
8 error_log /var/www/vu-hosting/domain.tld/logs/error_log;
9 root /var/www/vu-hosting/domain.tld/htdocs;

On Mon, Oct 26, 2009 at 06:49:09PM +0100, Steve wrote:

set
“*:80”
for
./configure --with-debug …

nginx.conf:

error_log /path/to/log debug;

2009/10/26 16:36:12 [emerg] 31458#0: host not found in “default_server” of the “listen” directive in /var/www/hosting/vhosts.conf.d/front/2000_domain.tld.conf:5

What host does nginx have issue to find?

Could you show the 5th line of the 2000_domain.tld.conf ?

On Mon, Oct 26, 2009 at 07:14:48PM +0100, Steve wrote:

3 set $vhost “domain.tld”;
4 set $vhost_root “/var/www/vu-hosting/$vhost”;
5 listen 80 default_server;
6 server_name www.domain.tld .domain.tld;
7 access_log /var/www/vu-hosting/domain.tld/logs/access_log combined;
8 error_log /var/www/vu-hosting/domain.tld/logs/error_log;
9 root /var/www/vu-hosting/domain.tld/htdocs;

Are you sure that it is this file ? This error message should be issued
for this:

listen default_server;

-------- Original-Nachricht --------

Datum: Mon, 26 Oct 2009 21:53:59 +0300
Von: Igor S. [email protected]
An: [email protected]
Betreff: Re: nginx-0.8.21

Are you sure that it is this file ? This error message should be issued
for this:

listen default_server;

I don’t have that there. I have the 80 in front of default_server. The
funny thing is that now I updated all the servers (backend as well) to
0.8.21 and the error is gone. And Firefox was right about the
redirection error:
alekto ~ # HEAD -H “Host:192.168.0.71” http://192.168.0.71/
301 Moved Permanently
Connection: close
Date: Mon, 26 Oct 2009 19:36:42 GMT
Location: http://192.168.0.71/
Server: nginx
Content-Length: 178
Content-Type: text/html
Client-Date: Mon, 26 Oct 2009 19:36:42 GMT
Client-Peer: 192.168.0.71:80
Client-Response-Num: 1
Client-Warning: Redirect loop detected (max_redirect = 7)

alekto ~ #

Looking again at the config file I detected a stupid error. I had this
in place:
1 server {
2 #====================================================
3 set $vhost “domain.tld”;
4 set $vhost_root “/var/www/vu-hosting/$vhost”;
5 listen 80 default_server;
6 server_name www.domain.tld .domain.tld;
7 access_log /var/www/vu-hosting/domain.tld/logs/access_log
combined;
8 error_log /var/www/vu-hosting/domain.tld/logs/error_log;
9 root /var/www/vu-hosting/domain.tld/htdocs;
10 #============================================
11 if ($host !~* "^(..)?(domain.tld)$") {
12 rewrite ^/(.
)$ http://$host/$1 permanent;
13 }
14 #============================================

This produces a loop. Stupid me! Checking if $host is not equal to
domain.tld and then rewriting the url to $host. Stupid! Stupid. The
right config should be:
1 server {
2 #====================================================
3 set $vhost “domain.tld”;
4 set $vhost_root “/var/www/vu-hosting/$vhost”;
5 listen 80 default_server;
6 server_name www.domain.tld .domain.tld;
7 access_log /var/www/vu-hosting/domain.tld/logs/access_log
combined;
8 error_log /var/www/vu-hosting/domain.tld/logs/error_log;
9 root /var/www/vu-hosting/domain.tld/htdocs;
10 #============================================
11 if ($host !~* "^(..)?(domain.tld)$") {
12 rewrite ^/(.
)$ http://www.$vhost/$1 permanent;
13 }
14 #============================================

// Steve

On Mon, Oct 26, 2009 at 08:45:46PM +0100, Steve wrote:

“default_server”

4 set $vhost_root “/var/www/vu-hosting/$vhost”;
listen default_server;
Client-Date: Mon, 26 Oct 2009 19:36:42 GMT
3 set $vhost “domain.tld”;
14 #============================================
8 error_log /var/www/vu-hosting/domain.tld/logs/error_log;
9 root /var/www/vu-hosting/domain.tld/htdocs;
10 #============================================
11 if ($host !~* "^(..)?(domain.tld)$") {
12 rewrite ^/(.
)$ http://www.$vhost/$1 permanent;
13 }
14 #============================================

The right config should be

 server {
     listen  80 default_server;
     server_name  _;  # just nonexistant domain name
     rewrite    ^   http://www.domain.tld$request_uri? permanent;
 }

 server {
     listen  80;
     server_name  .domain.tld;
                 # www.domain.tld is matched by .domain.tld;
     ...
 }

2009/10/26 Igor S. [email protected]:

    server_name  .domain.tld;
          # www.domain.tld is matched by .domain.tld;

so that is shorthand for server_name domain.tld www.domain.tld; ?

On Mon, Oct 26, 2009 at 02:40:10PM -0700, Michael S. wrote:

2009/10/26 Igor S. [email protected]:

š š š š server_name š.domain.tld;
š š š š š š š š š š # www.domain.tld is matched by .domain.tld;

so that is shorthand for server_name domain.tld www.domain.tld; ?

No. .domain.tld is shorthand for domain.tld and *.domain.tld.

On Mon, Oct 26, 2009 at 21:40, Michael S. [email protected] wrote:
[…]

so that is shorthand for server_name domain.tld www.domain.tld; ?

http://wiki.nginx.org/NginxHttpCoreModule#server_name

On Mon, Oct 26, 2009 at 22:00, Michael S. [email protected] wrote:
[…]

“two of the above can be combined” … Â I’m going to change the wording quick.

“the first two above” perhaps?

I put it in parens - I think that explains it

2009/10/26 Nuno Magalhães [email protected]:

i figured someone would link the wiki however if you look at the
language in there it is a bit confusing

“two of the above can be combined” … I’m going to change the wording
quick.

2009/10/26 Nuno Magalhães [email protected]: