Maxmind makes a variety of APIs and tools to use their geolocation database and one such tool is the mod_geoip module for Apache. This article will show you how to setup Nginx’s own geoip module and mimic the same variables presented to PHP like Apache does.
Tag: Nginx
Nginx as a Proxy to your Blog
If you’re big into autoblogs and cross-linking you’ll likely like this. Have you ever had most of your blogs on a single server (probably behind cpanel or directadmin), but wanted some of your domains to appear to be on a different IP, or even in a different country? Well this article shows you how to setup an nginx server as a proxy so that visitors see a different IP than where the site is hosted.
Apache to Nginx Migration Tips
Nginx currently holds shy of 6.5% of the known webserver market, which is just roughly shy of 13 million servers. This little lightweight webserver created by a sole Russian developer has been gaining a great deal of popularity over the last few years and is used by sites such as Wordpress, Texts from Last Night and Hulu.
This guide will provide you with common migration tips to move from an Apache server to an Nginx configuration.
My Nginx Configuration
I’m creating this page on popular request, as I’ve had to paste my configuration for people a number of times especially on IRC. Below is an example configuration of how kbeezie.com is setup with some comments.
Releasing IP Addresses in WHM/Cpanel
If you are hosted with a WHM/Cpanel based server or VPS, you may have had some difficulties trying to get an alternate webserver such as Nginx or Lighttpd installed especially if you wanted to use the default port 80. This article shows you how you can release extra IP addresses to be used by those services without conflicting with Apache.
Configuring SNI with NginX
Traditionally for every SSL certificate issued, you needed a separate and unique IP address. However if you compile OpenSSL and NginX with TLS SNI (Server Name Identification) support you can install multiple SSL certificates without having to bind a domain name to a specific IP address or require each certificate to have its own unique IP.
Path_Info & PHP_SELF woes [NginX]
Over the last couple of years I’ve been constantly researching for a way to get the PHP environment variables to show up correctly. My latest pains were with PATH_INFO and PHP_SELF, which are now finally solved.
Using Namecheap’s Free SSL with Nginx
Most of my domains are registered with Namecheap, and powered by Nginx. The site you are viewing now is one such example. Currently with Namecheap, domain registrations, hosting, transfers and WhoIS protection come with a free PositiveSSL subscription. This section will show you how to generate a certificate request with OpenSSL and how to install the provided certificate into Nginx.
Nginx and Django
In a previous guide I showed how to use Passenger (aka mod_rails) to work with Python (WSGI) scripts. While this proved effective for simple wsgi applications, a framework such as Django required a bit more love. This guide will walk you through getting Django to work with Nginx and Passenger.