Custom Domain Setup
Das Einrichten einer benutzerdefinierten Domain für Ihre Dockit-Dokumentationsseite trägt zur Etablierung Ihrer Markenidentität bei und sorgt für ein professionelles Erscheinungsbild. Dieser Leitfaden behandelt den gesamten Prozess der Konfiguration benutzerdefinierter Domänen auf verschiedenen Hosting-Plattformen.
Overview
Section titled “Overview”Mit einer benutzerdefinierten Domain können Sie Ihre Dokumentation über Ihre eigene Marken-URL bereitstellen, anstatt über die Standard-Hosting-Provider-Subdomain. Zum Beispiel:
- Standard:
your-docs.netlify.appoderyour-docs.vercel.app - Custom:
docs.yourcompany.comorhelp.yourcompany.com
Prerequisites
Section titled “Prerequisites”Stellen Sie vor dem Einrichten einer benutzerdefinierten Domäne sicher, dass Sie über Folgendes verfügen:
- Domänenbesitz: Sie besitzen oder kontrollieren die Domäne, die Sie verwenden möchten
- DNS-Zugriff: Möglichkeit, DNS-Einträge für Ihre Domain zu ändern
- Bereitgestellte Site: Ihre Dockit-Site ist bereits bereitgestellt und funktioniert
- SSL certificate: HTTPS support (usually provided automatically)
Domain Configuration Options
Section titled “Domain Configuration Options”Subdomain Setup (Recommended)
Section titled “Subdomain Setup (Recommended)”Die Verwendung einer Subdomain ist der gebräuchlichste und empfohlene Ansatz:
docs.yourcompany.comhelp.yourcompany.comsupport.yourcompany.comknowledge.yourcompany.comRoot Domain Setup
Section titled “Root Domain Setup”Sie können auch Ihre Stammdomäne verwenden, dies erfordert jedoch zusätzliche Überlegungen:
yourcompany.comyourdocs.comPath-based Setup
Section titled “Path-based Setup”Dokumentation aus einem bestimmten Pfad bereitstellen:
yourcompany.com/docsyourcompany.com/helpPlatform-Specific Setup
Section titled “Platform-Specific Setup”Netlify Configuration
Section titled “Netlify Configuration”Step 1: Add Custom Domain in Netlify
Section titled “Step 1: Add Custom Domain in Netlify”- Gehen Sie im Netlify-Dashboard zu den Site-Einstellungen Ihrer Site
- Navigate to Domain management → Custom domains
- Click Add custom domain
- Geben Sie Ihre Domain ein (z. B.
docs.yourcompany.com)
Step 2: Configure DNS Records
Section titled “Step 2: Configure DNS Records”Fügen Sie einen CNAME-Eintrag bei Ihrem DNS-Anbieter hinzu:
Type: CNAMEName: docs (or your chosen subdomain)Value: your-site-name.netlify.appTTL: 3600 (or Auto)Step 3: Enable HTTPS
Section titled “Step 3: Enable HTTPS”Netlify automatically provisions SSL certificates through Let’s Encrypt:
- Warten Sie auf die DNS-Weitergabe (bis zu 24 Stunden).
- Das SSL-Zertifikat wird automatisch ausgestellt
- Force HTTPS redirect in Site Settings → HTTPS
Step 4: Configure _redirects (Optional)
Section titled “Step 4: Configure _redirects (Optional)”Erstellen Sie eine _redirects-Datei in Ihrem public/-Verzeichnis:
# Force HTTPShttp://docs.yourcompany.com/* https://docs.yourcompany.com/:splat 301!
# Redirect old paths/old-docs/* /new-docs/:splat 301/v1/* /latest/:splat 301
# SPA fallback/* /index.html 200Vercel Configuration
Section titled “Vercel Configuration”Step 1: Add Domain in Vercel
Section titled “Step 1: Add Domain in Vercel”- Gehen Sie zu Ihrem Projekt-Dashboard
- Navigate to Settings → Domains
- Geben Sie Ihre benutzerdefinierte Domäne ein
- Wählen Sie den Bereitstellungszweig
Step 2: Configure DNS
Section titled “Step 2: Configure DNS”Fügen Sie für Subdomains einen CNAME-Eintrag hinzu:
Type: CNAMEName: docsValue: cname.vercel-dns.comFügen Sie für Stammdomänen A-Einträge hinzu:
Type: AName: @Value: 76.76.19.61
Type: AName: @Value: 76.76.19.62Step 3: Verify Domain
Section titled “Step 3: Verify Domain”Vercel verifiziert Ihre Domain automatisch und stellt SSL-Zertifikate aus.
Step 4: Configure vercel.json
Section titled “Step 4: Configure vercel.json”{ "redirects": [ { "source": "/old-path", "destination": "/new-path", "permanent": true } ], "headers": [ { "source": "/(.*)", "headers": [ { "key": "X-Content-Type-Options", "value": "nosniff" }, { "key": "X-Frame-Options", "value": "DENY" }, { "key": "X-XSS-Protection", "value": "1; mode=block" } ] } ]}GitHub Pages Configuration
Section titled “GitHub Pages Configuration”Step 1: Configure Repository Settings
Section titled “Step 1: Configure Repository Settings”- Go to repository Settings → Pages
- Select source (usually
mainbranch) - Fügen Sie im Feld Benutzerdefinierte Domäne eine benutzerdefinierte Domäne hinzu
Step 2: Create CNAME File
Section titled “Step 2: Create CNAME File”Erstellen Sie eine CNAME-Datei in Ihrem Repository-Stammverzeichnis oder public/-Verzeichnis:
docs.yourcompany.comStep 3: Configure DNS
Section titled “Step 3: Configure DNS”Add a CNAME record pointing to GitHub Pages:
Type: CNAMEName: docsValue: yourusername.github.ioStep 4: Enable HTTPS
Section titled “Step 4: Enable HTTPS”GitHub Pages stellt automatisch SSL-Zertifikate für benutzerdefinierte Domänen bereit.
Firebase Hosting Configuration
Section titled “Firebase Hosting Configuration”Step 1: Configure firebase.json
Section titled “Step 1: Configure firebase.json”{ "hosting": { "public": "dist", "site": "your-project-id", "cleanUrls": true, "trailingSlash": false, "rewrites": [ { "source": "**", "destination": "/index.html" } ], "headers": [ { "source": "**/*.@(jpg|jpeg|gif|png|svg|webp|js|css)", "headers": [ { "key": "Cache-Control", "value": "max-age=31536000" } ] } ] }}Step 2: Add Custom Domain
Section titled “Step 2: Add Custom Domain”firebase hosting:channel:deploy live --only hostingfirebase hosting:site:get your-project-idAdd domain in Firebase Console:
- Go to Hosting section
- Click Add custom domain
- Befolgen Sie die Verifizierungsschritte
Step 3: DNS Configuration
Section titled “Step 3: DNS Configuration”Fügen Sie die bereitgestellten DNS-Einträge aus der Firebase-Konsole hinzu.
DNS Provider Examples
Section titled “DNS Provider Examples”Cloudflare DNS
Section titled “Cloudflare DNS”Type: CNAMEName: docsContent: your-site.netlify.appProxy status: Proxied (orange cloud)TTL: AutoAdditional Cloudflare settings:
- SSL/TLS: Full (strict)
- Always Use HTTPS: On
- Automatic HTTPS Rewrites: On
Google Domains
Section titled “Google Domains”Type: CNAMEName: docsData: your-site.netlify.app.TTL: 1 hourNamecheap DNS
Section titled “Namecheap DNS”Type: CNAME RecordHost: docsValue: your-site.netlify.appTTL: AutomaticRoute 53 (AWS)
Section titled “Route 53 (AWS)”{ "Type": "CNAME", "Name": "docs.yourcompany.com", "Value": "your-site.netlify.app", "TTL": 300}SSL Certificate Configuration
Section titled “SSL Certificate Configuration”Automatic SSL (Recommended)
Section titled “Automatic SSL (Recommended)”Most modern hosting platforms provide automatic SSL:
- Netlify: Let’s Encrypt (automatic)
- Vercel: Automatic SSL provisioning
- GitHub-Seiten: Automatisch für benutzerdefinierte Domänen
- Firebase: Google-managed certificates
Manual SSL Configuration
Section titled “Manual SSL Configuration”Für erweiterte Setups benötigen Sie möglicherweise eine manuelle SSL-Konfiguration:
server { listen 443 ssl http2; server_name docs.yourcompany.com;
ssl_certificate /path/to/certificate.crt; ssl_certificate_key /path/to/private.key;
ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512; ssl_prefer_server_ciphers off;
location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }}Advanced Configuration
Section titled “Advanced Configuration”Multiple Domains
Section titled “Multiple Domains”Konfigurieren Sie mehrere Domänen für dieselbe Site:
[[redirects]] from = "https://old-docs.com/*" to = "https://docs.yourcompany.com/:splat" status = 301 force = true
[[redirects]] from = "https://help.yourcompany.com/*" to = "https://docs.yourcompany.com/:splat" status = 301 force = trueInternationalization Domains
Section titled “Internationalization Domains”Richten Sie verschiedene Domänen für verschiedene Sprachen ein:
docs.yourcompany.com (English)docs-de.yourcompany.com (German)docs-fr.yourcompany.com (French)docs-es.yourcompany.com (Spanish)CDN Integration
Section titled “CDN Integration”Konfigurieren Sie CDN für eine bessere Leistung:
{ "functions": { "app/api/**/*.js": { "maxDuration": 30 } }, "regions": ["iad1", "sfo1", "fra1"], "github": { "enabled": false }}Security Best Practices
Section titled “Security Best Practices”HSTS Configuration
Section titled “HSTS Configuration”Enable HTTP Strict Transport Security:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadContent Security Policy
Section titled “Content Security Policy”Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; media-src 'self'; object-src 'none'; child-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'self';Additional Security Headers
Section titled “Additional Security Headers”X-Content-Type-Options: nosniffX-Frame-Options: DENYX-XSS-Protection: 1; mode=blockReferrer-Policy: strict-origin-when-cross-originPermissions-Policy: geolocation=(), microphone=(), camera=()Performance Optimization
Section titled “Performance Optimization”DNS Optimization
Section titled “DNS Optimization”- Use fast DNS providers: Cloudflare, Route 53, or Google DNS
- Minimize DNS lookups: Reduce external resource dependencies
- Enable DNS prefetching:
<link rel="dns-prefetch" href="//example.com">
Caching Strategy
Section titled “Caching Strategy”# Static assetsCache-Control: public, max-age=31536000, immutable
# HTML filesCache-Control: public, max-age=0, must-revalidate
# API responsesCache-Control: public, max-age=300, s-maxage=600Monitoring and Analytics
Section titled “Monitoring and Analytics”Domain Health Monitoring
Section titled “Domain Health Monitoring”Richten Sie die Überwachung für Ihre benutzerdefinierte Domain ein:
// Basic uptime monitoringasync function checkDomainHealth() { try { const response = await fetch('https://docs.yourcompany.com/health'); if (response.ok) { console.log('Domain is healthy'); } else { console.error('Domain health check failed'); } } catch (error) { console.error('Domain is unreachable:', error); }}
setInterval(checkDomainHealth, 300000); // Check every 5 minutesAnalytics Configuration
Section titled “Analytics Configuration”<!-- Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script><script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_TRACKING_ID', { custom_map: { 'custom_parameter': 'dimension1' } });</script>Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”DNS Propagation Delays
Section titled “DNS Propagation Delays”Es kann bis zu 48 Stunden dauern, bis sich DNS-Änderungen weltweit vollständig verbreiten:
# Check DNS propagationdig docs.yourcompany.comnslookup docs.yourcompany.comOnline tools:
- whatsmydns.net
- dnschecker.org
SSL Certificate Issues
Section titled “SSL Certificate Issues”Häufige SSL-Probleme und Lösungen:
- Mixed content errors: Ensure all resources use HTTPS
- Certificate mismatch: Verify domain names match certificate
- Expired certificates: Set up auto-renewal
Redirect Loops
Section titled “Redirect Loops”Prevent infinite redirects:
# Incorrecthttps://docs.yourcompany.com → https://docs.yourcompany.com
# Correcthttp://docs.yourcompany.com → https://docs.yourcompany.comPerformance Issues
Section titled “Performance Issues”Leistungsprobleme diagnostizieren und beheben:
# Test site speedcurl -w "@curl-format.txt" -o /dev/null -s "https://docs.yourcompany.com"
# Check response headerscurl -I "https://docs.yourcompany.com"Debug Tools
Section titled “Debug Tools”DNS Debugging
Section titled “DNS Debugging”# Check A recordsdig A docs.yourcompany.com
# Check CNAME recordsdig CNAME docs.yourcompany.com
# Check MX recordsdig MX yourcompany.com
# Trace DNS resolutiondig +trace docs.yourcompany.comSSL Debugging
Section titled “SSL Debugging”# Check SSL certificateopenssl s_client -connect docs.yourcompany.com:443 -servername docs.yourcompany.com
# Test SSL configurationcurl -vI https://docs.yourcompany.comMigration Strategies
Section titled “Migration Strategies”Zero-Downtime Migration
Section titled “Zero-Downtime Migration”Planen Sie eine nahtlose Domänenmigration:
- Neue Domain vorbereiten: Einrichten und gründlich testen
- DNS mit niedriger TTL aktualisieren: Reduzieren Sie die Ausbreitungszeit
- Verkehr überwachen: Achten Sie auf etwaige Probleme
- Implement redirects: Guide users to new domain
- Update internal links: Change all references
- Benutzer benachrichtigen: Kommunizieren Sie die Änderung
Migration Checklist
Section titled “Migration Checklist”- Domain ownership verified
- DNS records configured
- SSL certificate active
- Redirects implemented
- Internal links updated
- External references notified
- Analytics tracking updated
- SEO considerations addressed
- Monitoring alerts configured
- Rollback plan prepared
Best Practices
Section titled “Best Practices”- Choose meaningful subdomains: Use clear, descriptive names
- Enable HTTPS everywhere: Never serve content over HTTP
- Monitor domain health: Set up uptime monitoring
- Planen Sie für Katastrophen: Halten Sie Backup-Domänen bereit
- Dokumentieren Sie Ihr Setup: Bewahren Sie Konfigurationsaufzeichnungen auf
- Regelmäßige Wartung: Konfigurationen überprüfen und aktualisieren
- Sicherheit geht vor: Implementieren Sie die richtigen Header und Richtlinien
- Leistung zählt: Optimieren Sie für Geschwindigkeit und Zuverlässigkeit
Conclusion
Section titled “Conclusion”Das Einrichten einer benutzerdefinierten Domäne für Ihre Dockit-Dokumentationsseite verbessert Ihre Markenpräsenz und bietet Ihren Benutzern ein professionelles Erlebnis. Befolgen Sie die plattformspezifischen Anweisungen, implementieren Sie geeignete Sicherheitsmaßnahmen und überwachen Sie den Zustand Ihrer Domain, um die besten Ergebnisse zu erzielen.
Denken Sie daran, gründliche Tests in einer Staging-Umgebung durchzuführen, bevor Sie Änderungen an Produktionsdomänen vornehmen, und halten Sie für den Fall von Problemen immer einen Rollback-Plan bereit.
