Custom Domains

Complete guide to setting up custom domains for Ticket System

Custom Domains Overview

Custom domains allow you to brand your Ticket System with your own domain name. This guide covers:

  • Understanding custom domain benefits
  • Setting up DNS configuration
  • Configuring SSL certificates
  • Branding and customization
  • Multi-domain management

Benefits of Custom Domains

1. Professional Branding

  • Use your own domain name
  • Maintain brand consistency
  • Build customer trust
  • Professional appearance

2. SEO and Marketing

  • Better search engine rankings
  • Easier to remember URLs
  • Improved marketing campaigns
  • Brand recognition

3. Security and Trust

  • SSL certificate branding
  • Enhanced security perception
  • Reduced phishing risk
  • Professional security indicators

4. Enterprise Features

  • Multi-domain support
  • White-label solutions
  • Custom branding options
  • Advanced security features

DNS Configuration

1. Domain Setup

  1. Purchase a domain from a registrar (GoDaddy, Namecheap, etc.)
  2. Access your domain's DNS management panel
  3. Add the required DNS records
  4. Wait for DNS propagation (24-48 hours)

2. Required DNS Records

A Record

  • Type: A
  • Name: @ (or your subdomain)
  • Value: Your server IP address
  • TTL: 3600 (or default)

CNAME Record

  • Type: CNAME
  • Name: www
  • Value: yourdomain.com
  • TTL: 3600 (or default)

MX Record (Optional)

  • Type: MX
  • Name: @
  • Value: mail.yourdomain.com
  • Priority: 10

3. Example DNS Configuration

# Example DNS records for tickets.yourcompany.com

# A Record - Main domain
Type: A
Name: @
Value: 203.0.113.1
TTL: 3600

# CNAME Record - www subdomain
Type: CNAME
Name: www
Value: tickets.yourcompany.com
TTL: 3600

# A Record - API subdomain (if needed)
Type: A
Name: api
Value: 203.0.113.1
TTL: 3600

SSL Certificate Configuration

1. Let's Encrypt (Recommended)

Automatic Setup

  1. Install Certbot on your server
  2. Run: certbot --nginx -d yourdomain.com
  3. Follow the prompts
  4. Test the certificate

2. Commercial Certificates

  • Wildcard Certificates: Cover all subdomains
  • Multi-Domain Certificates: Cover multiple domains
  • Extended Validation: Enhanced security indicators
  • Custom Branding: Your company name in certificate

3. Certificate Management

  • Auto-Renewal: Automatic certificate renewal
  • Monitoring: Certificate expiration alerts
  • Backup: Certificate backup procedures
  • Rollover: Seamless certificate updates

Web Server Configuration

1. NGINX Configuration

# /etc/nginx/sites-available/yourdomain.com
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name yourdomain.com www.yourdomain.com;

    # SSL Configuration
    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
    ssl_prefer_server_ciphers off;

    # Security Headers
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";

    # Main application
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }

    # Bot webhook endpoint
    location /webhook/ {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

2. Apache Configuration

<VirtualHost *:80>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    Redirect permanent / https://yourdomain.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
    
    ProxyPreserveHost On
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    
    ProxyPass /webhook/ http://localhost:3001/webhook/
    ProxyPassReverse /webhook/ http://localhost:3001/webhook/
</VirtualHost>

Branding and Customization

1. Logo and Branding

  • Logo Upload: Add your company logo
  • Favicon: Custom browser icon
  • Color Scheme: Match your brand colors
  • Typography: Use your brand fonts

2. Content Customization

  • Page Titles: Custom page titles
  • Meta Descriptions: SEO-optimized descriptions
  • Custom Pages: Add your own content
  • Footer Information: Company details and links

3. Email Branding

  • Email Templates: Custom email designs
  • Sender Information: Your company details
  • Email Domain: Use your domain for emails
  • Email Signatures: Professional signatures

4. Advanced Customization

  • Custom CSS: Advanced styling options
  • JavaScript: Custom functionality
  • API Integration: Connect with your systems
  • Custom Domains: Multiple domain support

Multi-Domain Setup

1. Enterprise Features

Multiple Domains

  • Support multiple domains
  • Domain-specific branding
  • Separate configurations
  • Domain isolation

White-Label Solutions

  • Complete brand removal
  • Custom domain branding
  • White-label support
  • Custom documentation

Advanced Security

  • Domain-specific SSL
  • Custom security policies
  • Advanced monitoring
  • Compliance features

2. Domain Management

  1. Add new domains in the dashboard
  2. Configure DNS records for each domain
  3. Set up SSL certificates
  4. Configure domain-specific settings
  5. Test domain functionality
  6. Monitor domain health

3. Domain Isolation

  • Separate Databases: Isolated data per domain
  • Custom Configurations: Domain-specific settings
  • Independent Analytics: Separate reporting
  • Custom Integrations: Domain-specific APIs

Monitoring and Maintenance

1. Domain Health Monitoring

  • SSL Certificate Monitoring: Expiration alerts
  • DNS Health Checks: Record validation
  • Uptime Monitoring: Availability tracking
  • Performance Monitoring: Response time tracking

2. Security Monitoring

  • SSL Certificate Validation: Certificate health checks
  • Security Headers: Header validation
  • Vulnerability Scanning: Security assessments
  • Access Logging: Traffic monitoring

3. Backup and Recovery

  • Certificate Backups: SSL certificate backups
  • Configuration Backups: Server config backups
  • DNS Backups: DNS record backups
  • Recovery Procedures: Disaster recovery plans

Troubleshooting

Common Issues

DNS Issues

  • Check DNS record configuration
  • Verify DNS propagation
  • Test DNS resolution
  • Contact DNS provider

SSL Certificate Issues

  • Check certificate validity
  • Verify certificate installation
  • Test SSL configuration
  • Renew expired certificates

Web Server Issues

  • Check web server configuration
  • Verify port accessibility
  • Test server connectivity
  • Review error logs

Branding Issues

  • Check logo file formats
  • Verify image dimensions
  • Test color compatibility
  • Clear browser cache

Debug Commands

# Check DNS resolution
nslookup yourdomain.com
dig yourdomain.com

# Check SSL certificate
openssl s_client -connect yourdomain.com:443 -servername yourdomain.com

# Test web server
curl -I https://yourdomain.com
curl -I http://yourdomain.com

# Check NGINX configuration
nginx -t
systemctl status nginx

# Check SSL certificate expiration
certbot certificates

Best Practices

1. Domain Selection

  • Choose a memorable domain name
  • Use HTTPS by default
  • Keep domain names short
  • Consider internationalization

2. Security Configuration

  • Use strong SSL certificates
  • Implement security headers
  • Regular security audits
  • Monitor for vulnerabilities

3. Performance Optimization

  • Use CDN for static assets
  • Optimize image delivery
  • Implement caching strategies
  • Monitor performance metrics
  • 4. Maintenance Procedures

    • Regular certificate renewal
    • DNS record validation
    • Backup procedures
    • Update security patches

    Next Steps

    After setting up custom domains:

    1. Customize Dashboard - Configure branding and appearance
    2. Set Up Analytics - Track domain performance
    3. Configure Staff Access - Set up domain-specific permissions
    4. Optimize Categories - Configure domain-specific categories