如何在托pipe网站的服务器上使用反向代理?

我有一个服务器托pipe一个网站,我试图另外作为一个反向代理服务器。 目的是将应用程序的URL从http://www.acme.bar.com:8760/Application混淆到loremipsum.bar.com。

我有一个别名loremipsum.bar.com指向反向代理/ Web主机与以下虚拟主机configuration:

<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/public <Directory /var/www/public> Options Indexes FollowSymLinks MultiViews AllowOverride All order allow,deny allow from all </Directory> # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, eg #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> <VirtualHost *:80> ProxyPass / http://www.acme.bar.com:8760/Application ProxyPassReverse / http://www.acme.bar.com:8760/Application ServerName loremipsum.bar.com </VirtualHost> 

不幸的是,现在访问loremipsum.bar.com给ERR_TOO_MANY_REDIRECTS并超时。

尝试使用类似Fiddler(或浏览器的开发人员工具networking检查器持续请求打开)来观察redirect正在发送导致redirect循环。 您也可以尝试在代理url末尾添加斜线,以防万一 – 这就是我设置的方式, http://httpd.apache.org/docs/2.2/mod /mod_proxy.html#proxypassreverse有它。