iandouglas.com | senior web architect

Archive for January 2010

I learned a little something about nginx, a small footprint web server that is ideal for serving up mobile sites, or sites where you don’t want the heavy usage of Apache. Today, I needed to solve a problem where we redirected iPhone/iPod users to a different URL. Since nginx doesn’t use the old-style mod_rewrite rules, I had to learn how to enable redirection in the server.

Since nginx was already compiled with redirection support, I simply had to locate the correct configuration file and add a few lines of code, and away it went.

First, I checked out /etc/nginx/ and opened the site configuration file within the /sites-enabled/ path. For this example, let’s say the site was m.iandouglas.com:

# vi /etc/conf/nginx/sites-enabled/m.iandouglas.com

In here, I’d look for the ‘server’ block and add my redirection rules:

server {
	listen      80;
	server_name m.iandouglas.com;
        root /var/www/m.iandouglas.com/public;

	# redirect iPhone/iPod users to the new iphone site
        if ($http_user_agent ~* '(iPhone|iPod)') {
                rewrite ^/$ http://m.iandouglas.com/iphone/index.html;
        }
.
.
.

Then a simple nginx restart:

# /etc/init.d/nginx restart

… and we were all set.

,

Jan/10

20

dream come true

I think I was 8 years old when my dad came home with a Commodore 64 and various games. Hacking up those games in C64 Basic is what got me interested in programming, and now 20-something years later I landed a job at Armor Games as a Sr Web Developer. Not doing game programming, but I *am* in the industry where I’m happiest, and the web development work so far has been a nice change from the heavy lifting I’ve been doing in Perl for so long. For obvious reasons I won’t blog about specifics going on here at the office, but I may share insights into some of the things I’m learning.

,

CNET posted a HOWTO video on how to enable a much broader Control Panel setup by creating a folder with a specific filename.

In a nutshell, create a folder in the root level of any drive, and call it “GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}” (without the quotes).

Older posts >>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

 

January 2010
S M T W T F S
« Dec   Feb »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

Theme Design by devolux.org