Link Proxy Installation and Configuration
Octeth's Link Proxy add-on provides an extra layer of security and performance for your email campaigns. It routes all link tracking and click events through a separate proxy server, keeping your main Octeth server private and unexposed to direct public access.
Benefits
- Enhanced Security: Main Octeth server remains unexposed to public internet
- Better Performance: Dedicated server handles link redirects and tracking
- Scalability: Separate infrastructure for high-volume click tracking
- SSL Management: Automatic SSL certificate provisioning for tracking domains
Server Requirements
The Link Proxy requires a minimal Ubuntu 24.04 server:
- CPU: 2 vCPUs
- RAM: 4 GB
- Storage: 40 GB SSD
- OS: Ubuntu 24.04
- Network: Public IPv4 address
- Name: octeth-link-proxy
For this example, assume your hosting provider assigned 203.0.113.20 to the server.
Server Setup
Connect to the Server
SSH login to your link proxy server:
ssh-keygen -R '[203.0.113.20]:22'
ssh-keyscan -H -p 22 203.0.113.20 >> ~/.ssh/known_hosts
ssh root@203.0.113.20 -p 22Update System Packages
Update the server to the latest packages:
apt update
apt upgrade
# Reboot if kernel updates were installed
shutdown -r nowInstall Required Packages
Install system dependencies:
apt install -y software-properties-common sharutils apt-utils iputils-ping telnet git unzip zip openssl vim wget debconf-utils cron supervisor mysql-client docker.io ufw makeInstall Docker and Docker Compose
The Link Proxy runs in Docker containers. Install Docker:
# Install prerequisites
apt install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
# Install Docker packages
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Start Docker
systemctl start docker
# Verify Docker is running
systemctl status dockerInstall Link Proxy Add-On
Clone the Repository
Download the Link Proxy add-on from GitHub:
mkdir -p /opt/oempro-link-proxy
cd /opt/oempro-link-proxy
git clone https://github.com/octeth/oempro-link-proxy.git .
cp Caddyfile.example CaddyfileConfigure Caddyfile
Edit the Caddyfile to configure the reverse proxy and SSL settings:
vi CaddyfileUpdate the configuration with your settings:
# Reference:
# https://ohdear.app/blog/how-we-used-caddy-and-laravels-subdomain-routing-to-serve-our-status-pages
# IMPORTANT: The on_demand_tls configuration is critical for security.
# Without it, the proxy could issue SSL certificates for any domain pointed to your server!
{
on_demand_tls {
# Visit Octeth admin section > Settings > Email Delivery
# Copy the "On-Demand SSL Domain URL" value and paste it here
ask http://203.0.113.10/app/domain_verify/run/your-verification-token-here
}
}
http:// {
redir https://{host}{uri}
}
https:// {
tls admin@example.com {
on_demand
}
# https://caddyserver.com/docs/caddyfile/directives/reverse_proxy
reverse_proxy {
# Replace with your Octeth server IP
# Ensure the A record points directly to the Octeth server (not proxied through CloudFlare)
to http://203.0.113.10
header_down X-Test2 {system.hostname}
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
header_up X-Test1 {system.hostname}
header_up Host {host}
header_up StatusPageHost {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
header_up X-Forwarded-Port {server_port}
header_up X-Forwarded-Proto {scheme}
}
}Configuration Notes
- Replace
203.0.113.10with your actual Octeth server IP - Replace
admin@example.comwith your email for SSL certificate notifications - Get the verification token from Octeth Admin > Settings > Email Delivery
- The verification URL ensures only authorized domains get SSL certificates
Build and Run
Build the Docker image and start the container:
make build
make runVerify Container Status
Confirm the Docker container is running:
docker psYou should see the oempro-link-proxy container in the running state.
DNS Configuration
Setup Base Domain
Create an A record pointing to your Link Proxy server:
link.example.com A 203.0.113.20Setup Tracking Domains
For each link tracking domain you want to use, create a CNAME record pointing to your base domain:
track.yourdomain.com CNAME link.example.com
links.yourbrand.com CNAME link.example.comMultiple Tracking Domains
You can configure unlimited tracking domains as CNAME records. Each will automatically get an SSL certificate when first accessed.
Configure Octeth
In the Octeth Admin Dashboard:
- Go to Settings > Email Delivery
- Find Link Proxy Settings section
- Enable Use Link Proxy
- Enter your Link Proxy server details
- Configure allowed tracking domains
- Save changes
Testing
Test Link Redirection
Send a test campaign and click a tracked link. The link should:
- Redirect through your Link Proxy domain
- Use HTTPS with a valid SSL certificate
- Track the click in Octeth analytics
- Redirect to the final destination URL
Monitor Logs
View Link Proxy logs to troubleshoot issues:
docker logs -f oempro-link-proxyTroubleshooting
SSL Certificate Issues
If SSL certificates aren't being issued:
- Verify the verification URL in Caddyfile is correct
- Check that DNS records are properly configured
- Ensure the domain is allowed in Octeth settings
- Review Caddy logs:
docker logs oempro-link-proxy
Connection Issues
If links aren't redirecting:
- Verify the reverse proxy
toaddress points to your Octeth server - Check that the Octeth server is accessible from the Link Proxy
- Ensure port 80 and 443 are open on the Link Proxy server
- Test connectivity:
curl http://203.0.113.10from the Link Proxy server
Next Steps
Your Link Proxy is now operational. Consider:
- Adding multiple tracking domains for different brands or campaigns
- Setting up monitoring and alerts for the Link Proxy server
- Configuring a firewall to restrict access to ports 80/443 only
- Implementing log rotation for Docker container logs

Help Portal