How to install nginx as a Reverse Proxy for Apache on Ubuntu 16.04

submited by
Style Pass
2020-06-25 19:20:49

This tutorial shows how you can set up nginx as a reverse proxy in front of an Apache2 web server on Ubuntu 16.04. 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.

In this tutorial, I use the hostname  with the IP address . These settings might differ for you, so you have to replace them where appropriate.

I’m assuming that you have an existing Apache vhost (I will use the apache default vhost in this tutorial) that is listening on port 80  on the IP address  that you want to proxy through nginx. I will use the Ubuntu LAMP tutorial as the basis. Please note that this tutorial covers http only, not https (SSL).

The first thing we have to do is configure our Apache vhost to listen on localhost  ( ) on an unused port other than 80  (e.g. 8000 ). Open /etc/apache2/ports.conf …

Leave a Comment