For many years, I was under the mistaken impression that there were basically two web server choices, Apache and IIS. My belief was founded in the fact that these were the only two I had ever used — not a very good foundation, I know.
My eyes have been opened recently and I have found that there are many options. There are web servers from Netscape, Apple, AOL and there are several other web servers available including lighttpd and nginx.
I’m using nginx for this blog and for several sites hosted on the same server. Overall, I’m very impressed — in fact, my experience so far has been exceptional. Admittedly, I was a little concerned installing a web server with such a minimal web site. However, I’ve used lighttpd in the past, so I’ve gotten over the psychological trauma of switching from a major web server provider (I’ve primarily used Apache in the past) and I’ve found nginx to be much more friendly to use than lighttpd.
The primary reason I switched away from Apache is performance. The Apache process is big and heavy and it feels bloated to me. Nginx and lighttpd are tiny and feel more nimble — I think mostly because they don’t try to be everything to everyone for all purposes. My first small web server was lighttpd. It works great as a web server, but it’s a nightmare to configure — especially for configuring Wordpress pretty URLs. I couldn’t get it to work at all with the lighttpd configuration files. However, configuring Worpress pretty URLs with nginx was as easy as setting it up for Apache (maybe even easier). Here’s my entire nginx configuration section for this domain (thewhyandthehow.com):
server {
listen 80;
server_name www.thewhyandthehow.com thewhyandthehow.com;
access_log /www/twath/logs/access_log main;
error_log /www/twath/logs/error_log;
root /www/twath/html/current;
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires 30d;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
}
location / {
index index.php index.html;
root /www/twath/html/current;
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?q=$1 last;
}
}
location ~ /\.ht {
deny all;
}
}
The section above in bold is the relevant configuration for Wordpress pretty permalinks under nginx. It’s a little redundant, but basically it says if the requested file doesn’t exist, pass the url to the Wordpress index.php. That’s it.
If you’re looking for an alternate web server, I highly recommend nginx. So far it’s been nothing but a positive experience for me.
Comments:









Comments on this entry are closed.