Nginx 代理如何工作 [英] how Nginx proxy works

查看:51
本文介绍了Nginx 代理如何工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是对 nginx 代理的工作原理很好奇.

I'm just curious about how nginx proxy works.

我有两台服务器,一台用于前端,另一台用于存储文件.

I have two servers, one for frontend and another for storing files.

目前所有的下载链接都是这样的

currently all download links looks like this

http://server2.com/examplefile.zip

相反,如果我启用 nginx(服务器 1)来代理服务器 2 的请求,那么链接看起来像

instead if I enable nginx (server 1) to proxy requests to server 2, so the links will look like

http://server1.com/proxy/examplefile.zip

但如果我这样做,两台服务器都会消耗带宽吗?

but if I do that, does both servers consume bandwidth?

如果用户通过 nginx 代理下载 1 GB 的文件,是两台服务器都消耗 1 GB 带宽还是仅服务器 2 消耗带宽?

if a user downloads a 1 GB file via nginx proxy does both servers consume 1 gb bandwidth or just server 2 consume bandwidth?

推荐答案

这取决于服务器的设置(例如,事物是否被缓存),以及它们相对于彼此的位置(以及您使用的流量统计)托管服务提供商).

This depends on the settings of the servers (e.g. whether things are cached), and their location relative to each other (as well as the traffic accounting used by your hosting provider).

这篇关于Nginx 代理如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆