Apache反向代理:我应该看到服务器的名称,我redirect到浏览器中?

这可能是我的期望是不正确的,但我认为configuration一个Apache的实例作为反向代理后,我会看到以下行为:

  • 我打到运行反向代理规则的server1:9089将请求转发到Server8:80
  • 我的请求被redirect到服务内容的Server8:80
  • 我的浏览器应该告诉我,我仍然“坐在”server1:80,而不是Server8:80

我没有看到这个 redirect后,我被导向的机器的主机名显示在浏览器的地址栏中。 (并且在redirect期间在浏览器的状态栏中可见)

我认为反向代理的“好处”的一部分是它隐藏了从用户那里负担繁重(Server8,在这种情况下)的机器/机器?

这是什么(我认为)是我的httpd.conf的相关部分:

# # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # localhost:9089 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory /> AllowOverride none Require all denied </Directory> #####PROXY ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://server8/ ProxyPassReverse / http://server8/ 

任何人都可以给我一个感觉,我在这里做错了吗? 或者我不明白什么是反向代理可以或不可以为我做的更基本的东西?

非常感谢!

这里显示的configuration是正确的。 发生什么事是后端服务器redirect到一个login页面(根据来自OP的进一步的评论),使用服务器的主机名称的URL。

在不知道使用哪种后端服务器技术的情况下,我不能说如何解决这个问题,但改变这种行为将解决问题。

Apache的代理不会更改此configuration中的redirectURL。