简体   繁体   English

设置代理服务器

[英]Setting up a proxy server

So I have a server set up (LAMP) server, this proxy has access to the internal network and I need to give the outside world access to this proxy in order to perform tasks. 因此,我有一个服务器设置(LAMP)服务器,此代理可以访问内部网络,并且我需要授予外部访问此代理的权限才能执行任务。

For example, you should be able to call that proxy with a POST request with the right parameters and the proxy should return the status of that post. 例如,您应该能够通过带有正确参数的POST请求来调用该代理,并且代理应返回该发布的状态。 Now let's say that post is being done in a php script called (something.php) in the main folder of that proxy. 现在,我们说该发布是通过该代理主文件夹中名为(something.php)的php脚本完成的。 How do I give access to the outside world to access that proxy? 我如何让外界访问该代理?

I hope this is clear, sorry I couldn't make it much clearer but if you have any further questions to clarify please let me know! 我希望这很清楚,对不起,我无法使其更清楚,但是如果您还有其他需要澄清的问题,请告诉我!

To setup a reverse proxy with Apache, you have to use mod_proxy together with mod_proxy_http , since you want to proxy HTTP requests. 要使用Apache设置反向代理,您必须将mod_proxymod_proxy_http一起使用,因为您想代理HTTP请求。 The manual is here . 手册在这里

A basic configuration straight from the manual is: 直接来自手册的基本配置是:

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

Now when the proxy server receives a request to /foo/whatever , it will itself download http://foo.example.com/bar/whatever and upload it back to the client. 现在,当代理服务器收到对/foo/whatever的请求时,它本身将下载http://foo.example.com/bar/whatever并将其上传回客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM