繁体   English   中英

如何配置Apache Proxy? 需要将没有域名的请求发送到差异服务器

[英]How to configure Apache Proxy? Need to send requests without a domain name to a diff server

我有一台装有Webmin和Virtualmin的CentOS 6.7服务器,可托管15个以上的网站。

一切正常。

但是,如果传入的请求没有域名(例如直接发送到http://1.1.1.1 ),我想将其发送到本地网络上的另一台服务器,例如192.168.1.10。

我以前做过这个,并且不记得它很复杂,但是现在我花了很多时间和挫败感来尝试完成这项工作

我不想配置错误的Apache,最终让黑客嘲笑我并通过我的服务器代理,所以我想确保它的配置正确

我还没有能够使它工作。

这是我的配置:

<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>

#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
ProxyVia On

#
# To enable a cache of proxied content, uncomment the following lines.
# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
#
#<IfModule mod_disk_cache.c>
#   CacheEnable disk /
#   CacheRoot "/var/cache/mod_proxy"
#</IfModule>
#

</IfModule>


<VirtualHost *:*>
    ProxyPreserveHost On

    ProxyPass / http://192.168.1.1:80/
    ProxyPassReverse / http://192.168.1.1:80/


</VirtualHost>

我知道了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

它可以在Webmin / Virtualmin本身中修复。

只需转到Virtualmin>(您的默认网站)>服务器配置>编辑代理网站

然后输入您的代理地址并启用它

http://192.168.1.1:80

它必须采用这种形式,例如192.168.1.1将无法工作:)

暂无
暂无

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

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