Install Nginx CentOS 6.4 (reverse proxy)

Nginx (pronounced “engine x”) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial will guide you through setting up Nginx as a reverse proxy in front of a Apache back-end.

The assumption for installing Nginx on CentOS 6.4 is that you are running as root and have a basic understanding of the software required but if you follow this tutorial you should be able to complete the task successfully.

Install Yum Priorities

For a brief overview on and how to configure Yum Priorities you can follow the instructions outlined in our Install YUM Priorities on CentOS tutorial.

# yum install yum-priorities

Installing Nginx on CentOS 6.4 x86_64

Install the EPEL x86_64 YUM Repository

# rpm -Uvh

Install the IUS x86_64 YUM Repository

# rpm -Uvh

Install Nginx (and Apache if you haven’t already)

Configure Nginx

Configure Apache

Edit the httpd.conf file so that Apache listens on port 8080 otherwise you’ll have a conflict with Nginx

Add Apache and Nginx to the system startup

Restart Apache and Nginx