Would you like to learn how to configure the Nginx server as a proxy on a computer running Ubuntu Linux? In this tutorial, we are going to configure the Nginx server as a proxy to an Apache server.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Nginx 1.18.0

In our example, the IP address of the Nginx server is 192.168.100.10.

In our example, the IP address of the Apache server is 192.168.100.9.

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial – Nginx as a proxy

Install the Nginx server.

Copy to Clipboard

Edit the Nginx configuration file for the default website.

Copy to Clipboard

Here is the file, before our configuration.

Copy to Clipboard

Here is the file, after our configuration.

Copy to Clipboard

In our example, the Nginx server will work as a proxy and send all requests to the remote server.

Restart the Nginx service.

Copy to Clipboard

Open your browser and enter the IP address of your web server.

In our example, the following URL was entered in the Browser:

• http://192.168.100.10

The Nginx server will work as a proxy and display the website of the Apache server.

Apache default page

Congratulations! You have finished the configuration of the Nginx server as a proxy.