【发布时间】:2021-04-24 21:46:18
【问题描述】:
为了允许访问不公开的特定服务器,我们构建了一个架构,其中包含一个暴露在互联网上的 Apache 网络服务器,我们希望将其配置为反向代理,以仅将一些请求重定向到私有服务器。 这是 httpd.conf 文件的一部分:
Listen 5000
<VirtualHost *:5000>
ServerAdmin webmaster@localhost
ServerName servername
ErrorLog /etc/httpd/conf/error.log
#<Location />
# ProxyPass "http://...:5000/"
# ProxyPassReverse "http://...:5000"
# Order allow,deny
# Allow from all
#</Location>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass "/" "http://...:5000/" interpolate connectiontimeout=30 timeout=12000
#RewriteRule ^(.*) "http://...:5000/$1"
#ProxyPassMatch ^(.*) "http://...:5000/$1"
ProxyPassReverse "/" "http://...:5000/"
</VirtualHost>
每当我们输入Listen 5000 时,大量不受欢迎的流量会通过服务器传递到 Internet 上的其他服务器。
在上面的代码中,注释行是我所做的一些尝试。
没有阻止服务器充当所有代理的配置有什么问题? 提前感谢您的帮助
【问题讨论】:
标签: apache server reverse-proxy httpd.conf listen