如何防止使用Go编写的HTTP服务器遭受DDoS攻击?

huangapple go评论111阅读模式
英文:

How to prevent DDoS Attack from HTTP server written in Go?

问题

我正在使用Go开发一个HTTP服务器,但似乎无法防止DDoS攻击。我需要为我的服务器实现一个防火墙吗?

还有另一种解决方案:我可以使用Nginx作为代理服务器来防止DDoS攻击,但这会使服务器部署变得复杂。

英文:

I'm developing an HTTP server in Go, but it doesn't seem to be able to prevent DDoS attacks. Do I need to implement a firewall for my server?

There's also another solution: I could use Nginx as proxy server to prevent DDoS attacks, but it will complicate server deployment.

答案1

得分: 6

> 我需要为我的服务器实施防火墙吗?

天啊,是的!

但是对于DDOS攻击,防火墙帮助有限。你需要能够快速分析攻击并修补响应。使用像fail2ban这样的工具可以更容易地实现这一点,但是你不确定是否需要防火墙或者它是否对DDOS攻击有帮助,这表明你可能会因为试图构建自适应防御而造成更多的伤害。因此,在你的情况下,我建议在遇到DDOS攻击之前不要担心,或者找一个能够提供网络级服务的好的托管公司来处理这种攻击。

英文:

> Do I need to implement a firewall for my server?

OMG YES!

But it won't help much for DDOS. You need to be able to profile the attack and patch responses quickly for this. Using something like fail2ban make this much easier, but that you weren't sure if you needed a fiewall / if it would help with DDOS suggests that you may easily do more harm than good by trying to build adaptive defences, hence in your case I'd recommend not worrying about a DDOS until you get one / get a good hosting company who can provide network level services if such an attack occurs.

答案2

得分: 1

我不认为Nginx比你的Go服务器更好或更差。你仍然需要一个真正的防火墙。

英文:

I don't think Nginx would be better or worse than your Go server. You still need a real firewall as well.

huangapple
  • 本文由 发表于 2013年4月2日 17:38:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/15760799.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定