How do I set a default host for nginx?
        Posted  
        
            by 
                ulf
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by ulf
        
        
        
        Published on 2011-11-10T23:40:23Z
        Indexed on 
            2012/10/17
            17:05 UTC
        
        
        Read the original article
        Hit count: 513
        
I'm trying to figure out how to set a default host for my nginx installation. I found this article in the nginx Wiki:
http://wiki.nginx.org/NginxVirtualHostExample#A_Default_Catchall_Virtual_Host
Unfortunately, this doesn’t work. After restarting I get this:
Restarting nginx: nginx: [emerg] unknown directive "http" in /etc/nginx/sites-enabled/catchall:1
nginx: configuration file /etc/nginx/nginx.conf test failed
After removing the http directive I get this:
Restarting nginx: nginx: [emerg] unknown log format "main" in /etc/nginx/sites-enabled/catchall:7
nginx: configuration file /etc/nginx/nginx.conf test failed
I’m on Ubuntu 10.04.3 where I’m using the official nginx PPA. Version 1.0.9 of nginx is running.
© Server Fault or respective owner