Nginx 1.0.0 is out!

I just happened to check the Nginx website today and discovered that version 1.0.0 stable has been released! I immediately downloaded it and updated my web server. So far so good, I’m currently rebuilding my Nginx conf files for my various sites. I learned a decent amount about Nginx configs this week and thought I’d take some time to show how my configs work. The config below is very basic and I just threw it together quickly

server {
    server_name	*.nigeldunn.com nigeldunn.com;
    rewrite ^ $scheme://www.nigeldunn.com$request_uri permanent;
}

server {

    server_name  www.nigeldunn.com;

    charset utf-8;

    root	/home/nigeldunn.com/public_html;
    index	index.php;

    error_log /path-to-logs/nginx.error.nigeldunn.com.log;

    keepalive_timeout    70;

    location / {
            try_files $uri $uri/ @rewrite;
    }

    location ~ /wp-content/(.*).php$ {
        deny all;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ (/index|wp-(.*)|/wp-admin/(.*)).php$ {
	access_log /path-to-logs/nginx.access.nigeldunn.com.log;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        /usr/local/nginx/conf/fastcgi_params;
    }
    
    location @rewrite {
	 rewrite ^/(.*)$ /index.php?q=$request_uri;
    }
    
    location ~ .php$ {
	deny all;
    }
}

I save these conf files in their own folder and load them into Nginx by adding the following to my /usr/local/nginx/conf/nginx.conf inside the http{} section.

        include /path-to-confs/*.conf;