Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
796 views
in Technique[技术] by (71.8m points)

proxy - 代理服务器和反向代理服务器之间有什么区别?(What's the difference between proxy server and reverse proxy server?)

代理服务器和反向代理服务器有什么区别?

  ask by translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The previous answers were accurate, but perhaps too terse.

(以前的答案是准确的,但也许太简洁了。)

I will try to add some examples.

(我会尝试添加一些例子。)

First of all, the word "proxy" describes someone or something acting on behalf of someone else.

(首先,“代理”一词描述了代表其他人行事的某人或某事。)

In the computer realm, we are talking about one server acting on the behalf of another computer.

(在计算机领域,我们谈论的是代表另一台计算机的一台服务器。)

For the purposes of accessibility, I will limit my discussion to web proxies - however, the idea of a proxy is not limited to websites.

(出于可访问性的目的,我将讨论限制在Web代理中 - 但是,代理的概念不仅限于网站。)

FORWARD proxy (前进代理)

Most discussion of web proxies refers to the type of proxy known as a "forward proxy."

(大多数关于Web代理的讨论都是指被称为“转发代理”的代理类型。)

The proxy event, in this case, is that the "forward proxy" retrieves data from another web site on behalf of the original requestee.

(在这种情况下,代理事件是“转发代理”代表原始被请求者从另一个网站检索数据。)

A tale of 3 computers (part I) (3台电脑的故事(第一部分))

For an example, I will list three computers connected to the internet.

(例如,我将列出连接到互联网的三台计算机。)

  • X = your computer, or "client" computer on the internet

    (X =您的计算机或互联网上的“客户端”计算机)

  • Y = the proxy web site, proxy.example.org

    (Y =代理网站proxy.example.org)

  • Z = the web site you want to visit, www.example.net

    (Z =您要访问的网站www.example.net)

Normally, one would connect directly from X --> Z.

(通常,人们可以直接从X --> Z.连接X --> Z.)

However, in some scenarios, it is better for Y --> Z on behalf of X , which chains as follows: X --> Y --> Z .

(但是,在某些情况下,代表X Y --> Z更好,其链如下: X --> Y --> Z)

Reasons why X would want to use a forward proxy server: (X希望使用转发代理服务器的原因:)

Here is a (very) partial list of uses of a forward proxy server.

(这是转发代理服务器的(非常)部分使用列表。)

  • 1) X is unable to access Z directly because

    (1)X无法直接访问Z,因为)

    • a) Someone with administrative authority over X 's internet connection has decided to block all access to site Z .

      (a)对X的互联网连接具有管理权限的人决定阻止对站点Z所有访问。)

      • Examples:

        (例子:)

        • The Storm Worm virus is spreading by tricking people into visiting familypostcards2008.com , so the system administrator has blocked access to the site to prevent users from inadvertently infecting themselves.

          (Storm蠕虫病毒通过欺骗人们访问familypostcards2008.com而蔓延,因此系统管理员已阻止访问该网站以防止用户无意中感染自己。)

        • Employees at a large company have been wasting too much time on facebook.com , so management wants access blocked during business hours.

          (一家大公司的员工在facebook.com上浪费了太多时间,因此管理层希望在工作时间禁止访问。)

        • A local elementary school disallows internet access to the playboy.com website.

          (当地小学不允许访问playboy.com网站。)

        • A government is unable to control the publishing of news, so it controls access to news instead, by blocking sites such as wikipedia.org .

          (政府无法控制新闻的发布,因此它通过阻止wikipedia.org等网站来控制对新闻的访问。)

          See TOR or FreeNet .

          (请参阅TORFreeNet 。)

    • b) The administrator of Z has blocked X .

      (b) Z的管理员阻止了X)

      • Examples:

        (例子:)

        • The administrator of Z has noticed hacking attempts coming from X, so the administrator has decided to block X's IP address (and/or netrange).

          (Z的管理员注意到来自X的黑客攻击尝试,因此管理员决定阻止X的IP地址(和/或netrange)。)

        • Z is a forum website.

          (Z是一个论坛网站。)

          X is spamming the forum.

          (X正在向论坛发送垃圾邮件。)

          Z blocks X.

          (Z阻挡X.)

REVERSE proxy (REVERSE代理)

A tale of 3 computers (part II) (3台电脑的故事(第二部分))

For this example, I will list three computers connected to the internet.

(在本例中,我将列出连接到互联网的三台计算机。)

  • X = your computer, or "client" computer on the internet

    (X =您的计算机或互联网上的“客户端”计算机)

  • Y = the reverse proxy web site, proxy.example.com

    (Y =反向代理网站proxy.example.com)

  • Z = the web site you want to visit, www.example.net

    (Z =您要访问的网站www.example.net)

Normally, one would connect directly from X --> Z.

(通常,人们可以直接从X --> Z.连接X --> Z.)

However, in some scenarios, it is better for the administrator of Z to restrict or disallow direct access and force visitors to go through Y first.

(但是,在某些情况下, Z管理员最好限制或禁止直接访问并强制访问者首先通过Y.)

So, as before, we have data being retrieved by Y --> Z on behalf of X , which chains as follows: X --> Y --> Z .

(因此,和以前一样,我们有Y --> Z代表X检索数据,其链如下: X --> Y --> Z)

What is different this time compared to a "forward proxy," is that this time the user X does not know he is accessing Z , because the user X only sees he is communicating with Y .

(与“转发代理”相比,这次的不同之处在于,这次用户X不知道他正在访问Z ,因为用户X只看到他正在与Y通信。)
The server Z is invisible to clients and only the reverse proxy Y is visible externally.

(服务器Z对客户端是不可见的,只有反向代理Y在外部可见。)

A reverse proxy requires no (proxy) configuration on the client side.

(反向代理不需要客户端(代理)配置。)

The client X thinks he is only communicating with Y ( X --> Y ), but the reality is that Y forwarding all communication ( X --> Y --> Z again).

(客户端X认为他只与YX --> Y )通信,但实际情况是Y转发所有通信( X --> Y --> Z再次)。)

Reasons why Z would want to set up a reverse proxy server: (Z想要设置反向代理服务器的原因:)

  • 1) Z wants to force all traffic to its web site to pass through Y first.

    (1)Z希望强制所有流量到其网站首先通过Y.)

    • a) Z has a large web site that millions of people want to see, but a single web server cannot handle all the traffic.

      (a)Z有一个庞大的网站,数百万人希望看到,但单个网络服务器无法处理所有流量。)

      So Z sets up many servers and puts a reverse proxy on the internet that will send users to the server closest to them when they try to visit Z. This is part of how the Content Distribution Network (CDN) concept works.

      (因此,Z设置了许多服务器并在互联网上放置了一个反向代理,当用户尝试访问Z时,会将用户发送到最靠近他们的服务器。这是内容分发网络(CDN)概念如何工作的一部分。)

  • 2) The administrator of Z is worried about retaliation for content hosted on the server and does not want to expose the main server directly to the public.

    (2)Z的管理员担心对服务器上托管的内容进行报复,并且不希望将主服务器直接暴露给公众。)

    • a) Owners of Spam brands such as "Canadian Pharmacy" appear to have thousands of servers, while in reality having most websites hosted on far fewer servers.

      (a)“加拿大药房”等垃圾邮件品牌的所有者似乎拥有数千台服务器,而实际上大多数网站托管的服务器数量要少得多。)

      Additionally, abuse complaints about the spam will only shut down the public servers, not the main server.

      (此外,有关垃圾邮件的滥用投诉只会关闭公共服务器,而不是主服务器。)

In the above scenarios, Z has the ability to choose Y .

(在上述场景中, Z有能力选择Y)

Links to topics from the post: (链接到帖子的主题:)

Content Delivery Network (内容分发网络)

forward proxy software (server side) (转发代理软件(服务器端))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...