Ruby Forum NGINX > catchall domain with 0.6.30

Posted by Thomas Seifert (Guest)
on 08.05.2008 12:41
(Received via mailing list)
Hey guys,

I'm trying to convert some virtual hosts to nginx currently and got it
running side-by-side with the current webserver on another ip.
Now I'm trying to set up the catchall host as taken from the docs but
I'm getting just an error message.
I must be doing something completely wrong, maybe you can point me at 
it.

My conf for that part is as follows:
    server {
        listen          80.xxx.xxx.xxx:80;
        server_name     _ *;
        access_log      /var/log/nginx/catchall-access.log main;
        include /etc/nginx/phplocation.conf;

        location / {
            index index.html;
            root  /home/path/image-server;
        }
    }

And the error is the usual
server name "*" is invalid in /etc/nginx/nginx.conf:64

Any ideas?


Regards,

thomas
Posted by Almir Karic (Guest)
on 08.05.2008 12:55
(Received via mailing list)
On Thu, May 8, 2008 at 12:31 PM, Thomas Seifert <thomas-lists@mysnip.de> 
wrote:
>        listen          80.xxx.xxx.xxx:80;

listen          80.xxx.xxx.xxx:80 default;
Posted by Igor Sysoev (Guest)
on 08.05.2008 13:15
(Received via mailing list)
On Thu, May 08, 2008 at 12:31:30PM +0200, Thomas Seifert wrote:

>        listen          80.xxx.xxx.xxx:80;
> And the error is the usual
> server name "*" is invalid in /etc/nginx/nginx.conf:64

The "*" was ugly hack that now is replaced with

  server_name_in_redirect  off;

The "*" has almost the same functionality, but not catchall function.

Now you may set

   server {
        server_name   _;
        # or server_name  some.name;

        server_name_in_redirect  off;
Posted by Igor Sysoev (Guest)
on 08.05.2008 13:21
(Received via mailing list)
On Thu, May 08, 2008 at 03:06:47PM +0400, Igor Sysoev wrote:

> > My conf for that part is as follows:
> >    }
> > 
> > And the error is the usual
> > server name "*" is invalid in /etc/nginx/nginx.conf:64
> 
> The "*" was ugly hack that now is replaced with
> 
>   server_name_in_redirect  off;
> 
> The "*" has almost the same functionality, but not catchall function.

The catchall server for given ip:port is the first server or defined
excplicity with "default" keyword:

        listen          80.xxx.xxx.xxx:80 default;
Posted by Thomas Seifert (Guest)
on 08.05.2008 13:21
(Received via mailing list)
Almir Karic schrieb:
> On Thu, May 8, 2008 at 12:31 PM, Thomas Seifert <thomas-lists@mysnip.de> wrote:
>   
>>        listen          80.xxx.xxx.xxx:80;
>>     
>
> listen          80.xxx.xxx.xxx:80 default;
>
>   
Thanks, thats something I missed.
But I added it and still the same error message.

Any further ideas?


Thanks,

thomas
Posted by Thomas Seifert (Guest)
on 08.05.2008 13:34
(Received via mailing list)
Igor Sysoev schrieb:
>         # or server_name  some.name;
>
>         server_name_in_redirect  off;
Hi Igor,

thanks a lot. That helped.
I updated the english wiki too as that was my reference :)


Regards,

thomas
Posted by Almir Karic (Guest)
on 08.05.2008 13:37
(Received via mailing list)
On Thu, May 8, 2008 at 1:15 PM, Thomas Seifert <thomas-lists@mysnip.de> 
wrote:
>
>  Thanks, thats something I missed.
>  But I added it and still the same error message.
>
>  Any further ideas?


if you add the default to listen directive you can take out the 
server_name.