Foursquare: Here’s A Solution to Your PleaseRobMe Problem
March 11, 2010 – 12:50 PM | 0 Comments

By now you have probably heard of PleaseRobMe a service which aggregates all of the foursquare check-in’s into one place using the tweets sent out through the application.  There has been a lot of uproar …

Read the full story »
Geek

Read about the latest geek trends, news, and gadgets right here!

Malware Report

Learn about the latest threats online, how to remove them, and even how to prevent them.

Software

Find all the latest and greatest software out there for Windows, Mac, and Linux.

Twitter

Keep up with the latest from one of the web’s hottest sites (twitter.com).

Video

Never miss another of my videos again – view the latest videos from live.besttechie.net!

RSS FeedEmail SubscriptionsTwitterYouTubeFacebook
buzz_button

Home » Geek, How To
    Share/Bookmark

How To: Configure Nginx As A Reverse Proxy

Submitted by Jeff Weisbein on June 8, 2009 – 6:19 PM0 Comments
How To: Configure Nginx As A Reverse Proxy

I previously wrote about why page load times are important and outlined a couple of ways you could improve your web servers performance with regards to page load time. One of the ways I mentioned was to use nginx as a reverse proxy to serve all of your static files while letting Apache handle all of the dynamic content. There are numerous reasons for doing this with your server. First, nginx has a very small memory footprint and second, it can serve static files very quickly.

The following instructions are the steps I took for installing and configuring nginx with Apache on Debian.

Install nginx:

apt-get install nginx

Once nginx is installed (don’t start it yet) we need to edit the configuration file. My nginx configuration file handles multiple domains because I host multiple sites on my server. In the link below is an excerpt of my configuration file which displays nginx handling two domains. I should also note you can add as many domains as you want into the configuration file.

The configuration file should be located in /etc/nginx/nginx.conf – to edit it simply use your favorite editor such as nano.

View nginx Example Configuration

When your configuration file is saved, you will need to edit your Apache ports.conf file to point the listen port to 8080. It should look like the excerpt below:

NameVirtualHost *:8080
Listen 127.0.0.1:8080

You may also additionally have to edit each Apache sites-enabled configuration file to point the site to port 8080 as opposed to 80 which nginx will be listening on – this is to avoid conflicts.

Once you have completed the edits you may want to install the Apache mod libapache2-mod-rpaf so all of your Apache access logs do not show 127.0.0.1 as the IP for who is accessing your server. To install this mod issue the following command:

apt-get install libapache2-mod-rpaf

After the mod is installed it should restart Apache, however, if it doesn’t, you can issue the command yourself:

/etc/init.d/apache2 restart

Finally, you will want to start up nginx using the following command:

/etc/init.d/nginx start

That should do it! If you have any problems and/or questions feel free to leave a comment.

Related Products:

Apache (Single/LP Version)
Sams Teach Yourself PHP, MySQL and Apache All in One (4th Edition)
Apache Cookbook: Solutions and Examples for Apache Administrators
Apache
Apache: The Definitive Guide (3rd Edition)

You might also like:

How To: Improve WordPress Performance

Why Page Load Times Are Important

Facebook Now 2x Faster, Is It Really?

Why Your Website Should Use A CDN (Content Delivery Network)

Tags: , , , , ,