# Setup with Apache HTTP Server

For Apache servers, configure mod_proxy as a reverse proxy for the sGTM container.

## Step 1. Enable the required modules

Enable the three required modules by running: sudo a2enmod proxy, sudo a2enmod proxy_http, and sudo a2enmod ssl.

## Step 2. Configure the VirtualHost

Add the following directives to your Apache configuration file (httpd.conf or the corresponding VirtualHost):

- ServerName yoursite.com.br
- ProxyRequests off (disables open proxy)
- ProxyPreserveHost off
- SSLProxyEngine on (enables HTTPS connection to the backend)
- RequestHeader set X-Forwarded-For “%{REMOTE_ADDR}e”
- RequestHeader set X-From-Cdn “cf-wascer”
- RequestHeader set CF-Connecting-Ip “%{REMOTE_ADDR}e”
- RequestHeader set Host “sst.yoursite.com.br”
- ProxyPass “/metrics” “https://sst.yoursite.com.br”
- ProxyPassReverse “/metrics” “https://sst.yoursite.com.br”

Restart Apache after applying the changes (sudo systemctl restart apache2).

Source: https://wascer.com/helpdesk/abordagem-same-origin/configuracao-via-apache-http-server
