引用wikepedia上的解析:
In computer networks, a reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client, appearing as if they originated from the proxy server itself.[1] Unlike a forward proxy, which is an intermediary for its associated clients to contact any server, a reverse proxy is an intermediary for its associated servers to be contacted by any client. In other words, a proxy acts on behalf of the client(s), while a reverse proxy acts on behalf of the server(s).
Quite often, popular web servers use reverse-proxying functionality, shielding application frameworks of weaker HTTP capabilities. In this context, "weaker" means limitations in ability to handle excessive load, and limitation in handling the entire variety of request formats that can adhere to HTTP(S) 1.x, HTTP(S) 2.x, or requests which may be hard to detect. A reverse proxy in such cases could transform HTTPS requests into HTTP requests, buffer incoming requests based on the load of the "shielded" server(s), handle cookies/session data, or transform one request into multiple requests and then synthesize the responses, among other possibilities.
其核心语句:
Unlike a forward proxy, which is an intermediary for its associated clients to contact any server, a reverse proxy is an intermediary for its associated servers to be contacted by any client.
首先,无论正向代理还是反向代理,它都是一个intermediary(中介),因为它处在中间,和客户端,服务端都有着联系,比较难区分。根据实际应用场景,其核心是它代表谁,和哪一方的关联度大。
个人理解:
再理想模型下:例如 我们只能通过中介(代理)租房,我们要租房,假如不能直接通过房东(服务器)直租,必须通过中介,从该角度上看中介为 正向代理
再例如:如果要去租南山区的公寓(服务器)。房东指定了几个中介(代理)为它们卖房,如果你执意要租南山区的公寓,就只能通过房东指定的中介实现租房。 反向代理
因为中介处于中间,本质就是中介的身份问题,看它为谁服务吧!