Apache HTTP Server's mod_proxy and mod_proxy_http modules let you forward specific URL paths to an upstream server while keeping your domain in the browser. This is the standard approach for any Apache-served site — shared hosting excluded, since shared hosts typically disable mod_proxy.
admaxxer.com.mod_proxy, mod_proxy_http, and mod_ssl enabled..htaccess.sudo a2enmod proxy proxy_http ssl
sudo systemctl reload apache2
Verify they loaded:
apache2ctl -M | grep -E 'proxy|ssl'
You should see proxy_module and proxy_http_module in the list.
Edit your virtual host config (e.g., /etc/apache2/sites-available/yourdomain.conf) and add inside the <VirtualHost> block:
<VirtualHost *:443>
ServerName yourdomain.com
# ... existing SSL, DocumentRoot, etc. ...
# Admaxxer pixel proxy
SSLProxyEngine on
ProxyPreserveHost Off
ProxyPass /js/script.js https://admaxxer.com/js/script.js
ProxyPassReverse /js/script.js https://admaxxer.com/js/script.js
ProxyPass /api/event https://admaxxer.com/api/event
ProxyPassReverse /api/event https://admaxxer.com/api/event
</VirtualHost>
SSLProxyEngine on is required because the upstream uses HTTPS. ProxyPreserveHost Off sends Host: admaxxer.com to the upstream rather than your domain — required for SNI on the Admaxxer side.
sudo apachectl configtest
sudo systemctl reload apache2
Always run configtest before reloading to catch syntax errors.
In Admaxxer go to Connections › Install, enable Custom proxy domain, and enter your domain. Copy the regenerated snippet and update your site's HTML.
curl -I https://yourdomain.com/js/script.js
# Expect: HTTP/2 200 content-type: application/javascript
curl -v -X POST https://yourdomain.com/api/event \
-H 'Content-Type: application/json' \
-d '{"name":"pageview","url":"https://yourdomain.com/"}'
# Expect: HTTP/2 200 or 204
If you cannot edit the VirtualHost config but mod_proxy is enabled, use .htaccess:
RewriteEngine On
RewriteRule ^js/script\.js$ https://admaxxer.com/js/script.js [P,L]
RewriteRule ^api/event(.*)$ https://admaxxer.com/api/event$1 [P,L,QSA]
The [P] flag triggers mod_proxy internally. Note: AllowOverride All must be set in your VirtualHost for .htaccess to work.
SSLProxyEngine on is missing. Check /var/log/apache2/error.log for "No protocol handler".mod_ssl is loaded and the server has network access to port 443 on admaxxer.com. Some firewalls block outbound HTTPS./js/script.js) not wildcards.mod_cache enabled, add CacheDisable /js/script.js and CacheDisable /api/event to avoid stale cached responses.Remove the ProxyPass and ProxyPassReverse lines from the VirtualHost, run apachectl configtest, and reload Apache. Disable the custom proxy domain in Admaxxer to revert the snippet.
Cloudflare · Vercel · Next.js · Nuxt · Netlify · WordPress · NGINX
See also: Connections › Install for the base snippet.