服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

Apache的mod_dir不断redirect到错误的端口

我有一个HAProxy的设置,在一个Varnishcaching的前面请求一个Apache2服务器。 Apache正在监听端口12345上的内部IP,并configuration了UseCanonicalPhysicalPort Off以防止该内部使用端口溢出。 我也用On和Offtesting了UseCanonicalPhysicalPort和UseCanonicalName不同组合。 但是,尽pipe有这些规范的指令,Apache2在接收到一个没有结尾斜杠的目录的请求时似乎有问题: UCPP: On, UCN: Not set: Request: https://www.example.org/test-page Response: Redirect(301) to http://www.example.org:12345/test-page/ UCPP: On, UCN: On Request: https://www.example.org/test-page Response: Redirect(301) to https://www.example.org:12345/test-page/ UCPP: Off, UCN: Off Request: https://www.example.org/test-page Response: Redirect(301) without Location header 这当然是行不通的,因为这个港口只是内部的。 该网站正在运行一个Joomla,这与设置工作正常,只是那些将从mod_dirredirect的文件夹似乎不工作。 我的Apacheconfiguration如下所示: <VirtualHost 192.168.150.100:12345> ServerName www.example.org UseCanonicalPhysicalPort Off UseCanonicalName On <Directory "/var/www/www.example.org"> […] </VirtualHost> 有没有办法来阻止这些redirect? 最好的办法是防止Apache内的错误redirect,但是我可以修改Varnish或HAProxy。 注意:请不要build议使用80端口,因为我在清漆上使用了Apache的多个端口(解决方法使VHosts更好地工作),因此这是不行的。