【问题标题】:How to configure Apache Proxy? Need to send requests without a domain name to a diff server如何配置 Apache 代理?需要将没有域名的请求发送到 diff 服务器
【发布时间】:2016-04-16 11:29:36
【问题描述】:

我有一个安装了 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>

【问题讨论】:

    标签: apache proxy webmin virtualmin


    【解决方案1】:

    我明白了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

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

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

    点赞http://192.168.1.1:80

    它必须是那种形式,例如 192.168.1.1 将不起作用 :)

    【讨论】:

    • 转发到不同的端口,格式如http://127.0.0.1:2222/
    猜你喜欢
    • 2018-06-26
    • 2011-12-27
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2015-08-25
    • 1970-01-01
    • 2012-09-13
    • 1970-01-01
    相关资源
    最近更新 更多