catchall domain with 0.6.30

Igor Sysoev is at rambler-co.ru
Thu May 8 15:06:47 MSD 2008


On Thu, May 08, 2008 at 12:31:30PM +0200, Thomas Seifert wrote:

> 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

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;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list