Do I need a reverse proxy for my website / REST API if my backend can also run on HTTPS?

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

Do I need a reverse proxy for my website / REST API if my backend can also run on HTTPS?

问题

我的目标是部署一个安全的网络服务器。据我所知,网络服务器通常在HTTP上运行,使用像nginx这样的反向代理来处理HTTPS。但是,我的服务器后端也可以运行在HTTPS上。

所以我想知道我是否真的需要像nginx这样的反向代理?它提供了任何必要的安全性吗?或者其他任何好处?除了一个可选的负载均衡器。

我预计使用反向代理会稍微降低服务器的性能。特别是因为nginx使用1个线程,而我的后端有多个线程来处理连接。

英文:

My goal is to deploy a secure web server. As far as I know, a web server normally runs on HTTP with a reverse proxy like nginx, that handles HTTPS. However, my server backend can also run on HTTPS.

So I am wondering if I really need a reverse proxy like nginx? Does it provide any necessary security? Or any other benefits? Besides an optional load balancer.

I expect using a reverse proxy would slightly decrease the performance of the server. Especially because nginx uses 1 thread and my backend has multiple threads for handling the connections.

答案1

得分: 2

没有必要设置代理,如果你可以直接托管HTTPS协议。反向代理设置的好处是潜在的负载平衡和SSL证书管理的集中化。

如果你不需要这两者,添加代理会不必要地复杂化事情。

特别是因为nginx只使用1个线程,而我的后端有多个线程来处理连接。

只是作为一个提醒,如果没有意识到,多线程不是处理多个连接所必需的。这不应该对你的服务产生太多,如果有的话,影响。

英文:

There is no need for a proxy setup if you can just host the HTTPS protocol directly. The benefits of a reverse proxy setup are potential load balancing and centralization of SSL certificate management.

If you don't need either of those, adding in the proxy unnecessarily complicates things.

> Especially because nginx uses 1 thread and my backend has multiple threads for handling the connections.

Just as an FYI if not aware, multiple threads is not necessary to handle multiple connections. This shouldn't have much, if any, impact on your service.

huangapple
  • 本文由 发表于 2023年6月13日 03:09:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76459638.html
匿名

发表评论

匿名网友

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

确定