反向代理为什么叫反向代理_什么是反向代理?

反向代理为什么叫反向代理

When we talk about servers, it’s common to hear the term “reverse proxy”.

当我们谈论服务器时,通常会听到“反向代理”一词。

In this post I want to explain what is a reverse proxy, and what it’s useful for.

在这篇文章中,我想解释什么是反向代理,以及它的作用。

Let’s first talk about what’s a proxy. A proxy is a server that accepts connections from clients, which actively configured the proxy server on their machines, in their network settings.

首先让我们谈谈什么是代理 。 代理服务器是一种接受客户端连接的服务器,客户端在其计算机上的网络设置中主动配置了代理服务器。

When a client makes a connection to a server, the requests always pass through that proxy server.

当客户端与服务器建立连接时,请求始终通过该代理服务器。

This practice has several uses. Companies and organizations can set up proxy servers to filter connections, provide more security, and log traffic. Without using the proxy, clients can’t reach the outside network. Proxy servers are also useful to provide privacy and avoid network restrictions imposed by countries governments.

这种做法有多种用途。 公司和组织可以设置代理服务器以过滤连接,提供更高的安全性并记录流量。 如果不使用代理,客户端将无法访问外部网络。 代理服务器还可用于提供隐私并避免各国政府施加的网络限制。

A reverse proxy on the other hand is set up by the server. It’s completely transparent to clients, they don’t know this middleman exists, but it does a very useful job on the servers, filtering requests and sending them to the appropriate service that handles them.

另一方面, 反向代理是由服务器设置的。 它对客户端是完全透明的,他们不知道这个中间人的存在,但是它在服务器上做得非常有用,可以过滤请求并将其发送到处理它们的适当服务。

It’s common to use Nginx as a reverse proxy, and have services written for example in Node.js listening on internal ports, unaccessible from the outside.

通常将Nginx用作反向代理 ,并使用例如Node.js编写的服务侦听内部端口,这些端口无法从外部访问。

Nginx in this case serves as the main request handler, and sends the appropriate requests, for example linking special subfolders or URLs to specific services.

在这种情况下,Nginx充当主请求处理程序,并发送适当的请求,例如将特殊的子文件夹或URL链接到特定的服务。

We can have 2 different Node.js apps doing 2 completely different things, and the user does not need to know about that.

我们可以有2个不同的Node.js应用程序来做2个完全不同的事情,并且用户不需要知道这一点。

Beside this routing functionality, which is what us developers will mostly use it for, reverse proxies are also great to filter and protect from attacks serving as a firewall, to introduce caching, to configure SSL, to handle load balancing, A/B testing, and much more.

除了这种路由功能(这是我们开发人员最常使用的路由功能)之外,反向代理还可以很好地过滤和防御充当防火墙的攻击,引入缓存,配置SSL,处理负载平衡,A / B测试,以及更多。

翻译自: https://flaviocopes.com/reverse-proxy/

反向代理为什么叫反向代理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值