How to Use an Apache Reverse Proxy with Philter
Describes how to configure an Apache reverse proxy in front of Philter.
Running the Apache web server in front of Philter can have a few benefits. You can use Apache's authentication mechanisms to have greater control over who can access Philter's API, you can use SSL termination at Apache, use Apache's logs for access statistics, for example.
When terminating the SSL at Apache, make sure that the Apache reverse proxy and Philter are running on the same host so unencrypted traffic is not being sent over the network.
To install and configure Apache on CentOS, RHEL and Amazon Linux follow the steps below. First, install the Apache:
1
sudo yum install httpd
Copied!
Create the Philter configuration by creating a configuration file at /etc/httpd/conf.d/philter.conf:
1
<VirtualHost *:80>
2
3
ProxyPreserveHost On
4
ServerName philter.mydomain.com
5
6
LogLevel warn
7
ErrorLog logs/philter.mydomain.com-error_log
8
CustomLog logs/philter.mydomain.com-access_log combined
9
10
<Location />
11
ProxyPass http://localhost:8080/
12
ProxyPassReverse http://localhost:8080/
13
</Location>
14
15
</VirtualHost>
Copied!
Start Apache:
1
sudo systemctl start httpd
Copied!
Make sure it started successfully:
1
sudo systemctl status httpd
Copied!
Set the Apache service to start automatically:
1
sudo systemctl enable httpd
Copied!
Verify you can access Philter through the reverse proxy:
1
curl http://philter.mydomain.com/api/status
Copied!
Last modified 1yr ago
Copy link