How to set up custom domain using reverse proxy for nginx / apache

If you can't or don't want to use Cloudflare to configure your custom domain, here is another way how to achieve the same result. You can configure a reverse proxy.

The reverse proxy allows you to set up a tracking page with your domain on your web server using your SSL certificate. When a customer goes to your tracking page, the reverse proxy is called first. It acts as an intermediary between your domain and TrackMage. So that it can use your SSL certificate.

Here is a simple illustration of how it works:


Here is how to configure a reverse proxy:

Step 1.

Go to your DNS provider and point your domain/subdomain to your webserver using A record.


Step 2.

Then add the config according to the type of your web server. This step might require advanced server configuration skills. Please contact your IT department.

Nginx

server {
    listen 80;
    listen 0.0.0.0:443 ssl;
    ssl_certificate fullchain.pem;
    ssl_certificate_key privkey.pem;
    server_name tracking.my-business.com;
location / { proxy_pass https://my-business.trackmage.com/; } }

Apache

<VirtualHost *:80>
    ServerAdmin support@example.com
    ServerName tracking.my-business.com
    Redirect permanent / https://tracking.my-business.com/
</VirtualHost>

<VirtualHost *:443> ServerName tracking.my-business.com SSLEngine on SSLCertificateFile cert.pem SSLCertificateKeyFile key.pem ProxyPreserveHost On ProxyPass / https://my-business.trackmage.com/ ProxyPassReverse / https://my-business.trackmage.com/ </VirtualHost>


Step 3.

Now go back and add your custom domain to TrackMage


Did this solve your problem?