दस्तावेज़ पर वापस
डोमेन और SSL

Trust Proxy Headers कॉन्फ़िगर करें

Upstream proxies के forwarded headers trust करने के लिए Traefik कॉन्फ़िगर करें ताकि आपके apps real visitor IPs देख सकें।

Intermediate6 min readUpdated 2026-03-29

Proxy headers trust क्यों करें?

जब आपका सर्वर Cloudflare, AWS ALB, या load balancer जैसे reverse proxy के पीछे होता है, तो आपके applications real visitor का IP नहीं बल्कि proxy का IP address देखते हैं। इससे टूट जाता है:

  • Rate limiting — सभी requests एक ही IP से आती दिखती हैं
  • Geolocation — location data गलत होता है
  • IP block lists — individual visitors को block नहीं कर सकते
  • Audit logsrequest.ip proxy IP return करता है

Trust Proxy Headers Traefik को forwarded headers (X-Forwarded-For, X-Real-IP) से real client IP पढ़ने के लिए कहता है।

Provider presets उपयोग करें

Server Compass में common providers के लिए built-in presets शामिल हैं:

  1. Server Settings > Proxy tab पर जाएं
  2. Trust Proxy Headers section खोलें
  3. Dropdown से preset चुनें:
    • Cloudflare — सभी Cloudflare IPv4/IPv6 CIDR ranges auto-fill
    • AWS ALB/ELB — अपना VPC CIDR डालें (जैसे 10.0.0.0/16)
    • DigitalOcean Load Balancer — अपना VPC CIDR डालें
    • Hetzner Load Balancer — अपना private network CIDR डालें
    • Custom — manually trusted IP ranges जोड़ें
  4. Save पर क्लिक करें — Traefik automatically restart होता है

PROXY Protocol (advanced)

AWS NLB या HAProxy जैसे load balancers के लिए जो HTTP headers की जगह PROXY Protocol use करते हैं:

  1. Proxy Protocol section expand करें
  2. PROXY Protocol enable करें
  3. अपने load balancer के trusted IP ranges जोड़ें
  4. Save करें — Traefik HTTP और HTTPS दोनों entrypoints पर PROXY Protocol accept करने के लिए configure होता है

Safety और rollback

Server Compass misconfiguration से बचाता है:

  • Automatic backup — हर बदलाव से पहले traefik.yml backup होता है
  • Health check — Traefik restart के बाद Server Compass verify करता है container चल रहा है
  • Auto-rollback — अगर Traefik start fail हो, backup restore होता है और Traefik पिछले config से restart होता है
  • Insecure mode warning — "Trust All Sources" development-only के रूप में flag होता है और IP spoofing के लिए vulnerable है

Screenshots

Trust Proxy Headers कॉन्फ़िगर करें - Screenshot 1

Frequently Asked Questions

क्या Cloudflare use करते हुए trust proxy headers चाहिए?

हां। इसके बिना, आपके apps real visitors' IPs की जगह Cloudflare के IP addresses देखते हैं। सभी Cloudflare IP ranges automatically trust करने के लिए Cloudflare preset चुनें।

अगर मैं गलत IP ranges डालूं तो क्या होगा?

Server Compass हर बदलाव से पहले backup बनाता है और Traefik start fail होने पर auto-rollback करता है। आप हमेशा settings re-edit कर सकते हैं।

Video Tutorials

Related Features

Ready to try Server Compass?

Download the app and deploy your first application in under 5 minutes.

Download Server Compass