Would you like to learn how to install the Apache traffic server as a reverse proxy for Nginx on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to perform the Apache traffic server installation on Ubuntu Linux in 5 minutes or less.
• Ubuntu 18.04
• Ubuntu 19.10
• Apache Traffic Server 8.0.5
• Nginx 1.16.1
In our example, the Apache Traffic Server service will listen on the TCP port 80.
In our example, the Nginx service will listen on the TCP port 8080.
Apache Traffic Server – Related Tutorial:
On this page, we offer quick access to a list of tutorials related to the Apache Traffic Server.
Tutorial Apache Traffic Server – Reverse Proxy Installation on Ubuntu Linux
Install the Apache Traffic Server.
Edit the records.config configuration file.
Locate the following line.
Change the service from port 8080 to port 80.
Restart the Apache traffic server.
Edit the remap.config configuration file.
Add the following lines at the end of this configuration file.
In our example, every connection to the IP address 200.200.200.200 on port 80 will be redirected to the localhost on port 8080.
You need to change the IP address 200.200.200.200 to your server IP address.
Restart the Apache traffic server.
Verify if the ATS service is listening on the TCP port 80.
Here is the command output.
You have finished the Apache traffic service configuration on Ubuntu LInux.
Tutorial Apache Traffic Server – Cache Configuration
The amount of disk space allowed for cache is specified on the configuration file named storage.config.
Edit this configuration file.
Here is the ATS default disk cache configuration.
This configuration allows the use of 256MB of disk space for cache.
The ATS cache configuration is set on the configuration file named records.config.
Edit the records.config configuration file.
Here is the ATS default cache configuration.
This configuration specifies the following:
• The ATS service will manage automatically the amount of RAM used for cache.
• Objects larger than 4MB will not be kept in the RAM cache.
• The Maximum object size that will be cached is unlimited.
After changing the configuration files, you need to restart the ATS service.
Congratulations! You are able to change the ATS service cache configuration.
Tutorial – Nginx Installation on Ubuntu Linux
Install the Nginx service.
Edit the Nginx configuration file named default.
Here is the file, before our configuration.
Change the Nginx default port from 80 to 8080.
Here is the file, after our configuration.
Restart the Nginx service.
Verify if the Nginx service is listening on the TCP port 8080.
Here is the command output.
You have finished the Nginx configuration to use the reverse proxy service.
Tutorial Apache Traffic Server – Testing your installation
After finishing installation, you need to test your configuration.
Open a browser software and enter the external IP address of your Apache traffic server.
In our example, the following URL was entered in the Browser:
• http://200.200.200.200
The ATS service will communicate with the Nginx service and answer your request.
Use the following command to verify if the ATS service is answering your request.
Here is the command output.
As you can see on the header, the Apache traffic server is answering the user request.