Custom Domains

Custom Domains

FluxLink allows you to use your own custom domains for your dynamic links instead of the default domain. This gives you a branded experience for your users and more control over your links.

Setting Up Custom Domains

1. Add a Domain in Settings

  1. Log in to your FluxLink dashboard
  2. Navigate to the Settings page
  3. In the Custom Domains section, enter your domain name (e.g., links.yourdomain.com)
  4. Choose a verification method:
    • DNS TXT Record (recommended): Verify ownership by adding a TXT record to your domain's DNS settings
    • File Upload: Upload a verification file to your web server
  5. Click Add Domain

2. Verify Domain Ownership

After adding the domain, you'll need to verify that you own it:

DNS TXT Record Verification

  1. In your domain registrar or DNS provider, add a TXT record with:
    • Host/Name: Your domain (e.g., links.yourdomain.com)
    • Type: TXT
    • Value: The verification token provided by FluxLink (e.g., fluxlink-verify=xyzABC123)
    • TTL: 3600 (or as recommended by your provider)
  2. Return to the FluxLink dashboard
  3. Click Verify Domain next to your domain
  4. If successful, the status will change to "Verified"

File Upload Verification

  1. Create a text file at the following URL on your domain:
    https://your-domain.com/.well-known/fluxlink-verification.txt
  2. Add the verification token provided by FluxLink as the only content in this file
  3. Return to the FluxLink dashboard
  4. Click Verify Domain next to your domain
  5. If successful, the status will change to "Verified"

3. DNS Configuration

After verifying your domain ownership, you need to configure your DNS to direct traffic to your FluxLink instance:

CNAME Record (Recommended)

Add a CNAME record in your DNS settings:

  • Host/Name: Your subdomain (e.g., links for links.yourdomain.com)
  • Type: CNAME
  • Value/Target: The domain where your FluxLink instance is hosted
  • TTL: 3600 (or as recommended by your provider)

A Record (Alternative)

Alternatively, you can use an A record:

  • Host/Name: Your subdomain (e.g., links)
  • Type: A
  • Value: The IP address of your FluxLink server
  • TTL: 3600

4. Web Server Configuration

Configure your web server to handle requests to your custom domain:

For Nginx

server {
    listen 80;
    server_name your-domain.com;
 
    location / {
        proxy_pass http://localhost:4000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

For Apache

<VirtualHost *:80>
    ServerName your-domain.com
    ProxyPreserveHost On
    ProxyPass / http://localhost:4000/
    ProxyPassReverse / http://localhost:4000/
</VirtualHost>

5. SSL Configuration (For HTTPS)

To secure your custom domain with HTTPS:

  • Use Let's Encrypt to generate a free certificate:
    certbot --nginx -d your-domain.com
  • Or enable SSL through your service provider (Cloudflare, etc.)

6. Testing Your Custom Domain

  1. Ensure DNS propagation is complete (may take up to 24-48 hours)
  2. Try accessing your domain with HTTP first before testing HTTPS
  3. Create a new link with your custom domain and test it on various platforms

Using Custom Domains in Links

Once your domain is verified and properly configured:

  1. When creating a new link, select your verified domain from the "Custom Domain" dropdown
  2. The link will be generated using your custom domain instead of the default domain
  3. Share the link with your users

Troubleshooting

If your custom domain isn't working:

  1. DNS Issues: Verify your DNS records are set up correctly and have propagated
  2. Verification Status: Ensure your domain is showing as "Verified" in FluxLink
  3. Web Server Configuration: Check your Nginx/Apache configuration
  4. SSL Certificate: Ensure SSL is properly configured for HTTPS links
  5. Firewall Settings: Make sure your server's firewall allows traffic on ports 80 and 443

Limitations

  • You can only use domains that you have verified
  • The domain must be properly configured with the correct DNS records
  • HTTPS requires a valid SSL certificate for your domain