Problem:
I have a server (Server A) hosted in Datacenter A, where a web server listens on ports 80 and 443 for the domain example.com. Unfortunately, Datacenter A does not offer DDoS protection.
To mitigate potential DDoS attacks, I plan to provision another server Server B in Datacenter B, which has strong anti-DDoS capabilities.
My goal is to:
- Point the
example.comdomain toServer B. - Proxy the traffic from
Server BtoServer Awithout modifying the content or headers. - Ensure that
Server Asees the original client's IP address in the request, as if the client connected directly toServer A.
Current Approach:
I'm currently using TCP streaming via NGINX on Server B to achieve this.
However, this solution feels somewhat complex, and I suspect there might be a simpler, more efficient method.
Questions:
What would be the easiest and most performance-efficient way to implement such a proxy?
Is my current solution with NGINX the best approach, or are there better alternatives that could simplify the setup and maintain high performance while ensuring the client's IP is preserved?