本文介绍了如何在公司代理后面配置Nginx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NginX是否有等效于apache的ProxyRemote指令?

Is there an equivalent of apache's ProxyRemote directive for NginX?

所以场景是我在公司代理后面,我想使用NginX对各种服务进行代理传递.我将在Apache中执行以下操作:

So the scenario is I am behind a corporate proxy and I want to do proxy passes for various services with NginX. I would do it in Apache with the following:

ProxyPass/localStackOverflow/ https://stackoverflow.com/

ProxyPass /localStackOverflow/ https://stackoverflow.com/

ProxyPassReverse/localStackOverflow/ https://stackoverflow.com/

ProxyPassReverse /localStackOverflow/ https://stackoverflow.com/

ProxyRemote https://stackoverflow.com/ http://(我的公司代理IP)

ProxyRemote https://stackoverflow.com/ http://(my corporate proxy IP)

我知道我在NginX中需要proxy_pass指令,但是找不到用于ProxyRemote的东西.

I know I need the proxy_pass directive in NginX but can't find what I would use for the ProxyRemote.

谢谢

推荐答案

您在Nginx前端Web服务器后面代理的服务器称为上游服务器.您将要参考 HttpUpstreamModule 的文档.这对您所熟悉的非常相似.如果不需要负载平衡,只需在配置中设置一台上游服务器,即可满足您的目的.

The servers you proxy behind an Nginx front-end web server are referred to as upstream servers. You will want to refer to the documentation for the HttpUpstreamModule. It's very similair to what you are familiar with. If you don't need load-balancing, you just setup the one upstream server in the configuration and it will serve your purpose.

这篇关于如何在公司代理后面配置Nginx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 06:02