Helpdesk Support

Official Supportmonk Company Blog!

NginxCP: Cpanel reverse proxy

May 9, 2013 , 10:49 pm

nginx_logoNginx is one of the high performance web server. It can be configured as reverse proxy in cpanel server to improve the site performance. In this article, I would like to discuss about configuring nginx as reverse proxy in cpanel server.

nginxCP is a cpanel plugin that is used to manage nginx service in cpanel server. As we know that nginx can handle static contents better than apache, we will configure nginx to run on port 80 and will forward dynamic requests to apache on port 8081. To configure nginx as revcrse proxy, we need to install an apache module mod_rpaf.

Mod_rpaf installation:

Login as root:
# cd /usr/local/src
# wget
# tar xvzf mod_rpaf-0.6.tar.gz
# cd mod_rpaf-0.6
# /usr/local/apache/bin/apxs -i -c -n mod_rpaf-2.0.c

For Apache 2.4 : You need to apply a patch for mod rpaf

git clone git://
patch mod_rpaf-0.6/mod_rpaf-2.0.c 2716030/mod_rpaf-2.0.c.patch


You can change apache port to 8081 from your whm tweak settings.

WHM > Server Configuration > Tweak Settings > Apache non-SSL IP/port


Now you need to install nginxCP plugin. You can check the steps given below.

# cd /usr/local/src
# wget
# tar xf nginxadmin.tar
# cd publicnginx
# ./nginxinstaller install

To server static files using nginx, you have to  convert apache virtualhost to nignx virtualhost. You can download the script at ,  rename it as , provide 755 permission and execute it. You have to create an empty file /usr/local/nginx/conf/vhost.conf

# touch /usr/local/nginx/conf/vhost.conf
# wget
#  cp nginx.txt
# chmod 755
# ./

Configuration is complete. You can test nginx configuration and can start it.

# [email protected] [~]# /usr/local/sbin/nginx -t
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful

# /etc/init.d/nginx start


Outsourced Customer Support