简体   繁体   English

Apache mod_proxy不转发所有请求

[英]Apache mod_proxy not forwarding all requests

I have a Bottle/Python app running on localhost:3000 that I am using Apache mod_proxy to forward requests to. 我有一个在localhost:3000上运行的Bottle / Python应用程序,我使用Apache mod_proxy来转发请求。 Its working 99% of the time, except when I try and go to a url like: 它的工作时间为99%,除非我尝试去网址时:

http://m2t.openseedbox.com/api/upload/http%3A%2F%2Ftorrents.thepiratebay.se%2F6753175%2FPioneer_One_S01E04_720p_x264-VODO.6753175.TPB.torrent http://m2t.openseedbox.com/api/upload/http%3A%2F%2Ftorrents.thepiratebay.se%2F6753175%2FPioneer_One_S01E04_720p_x264-VODO.6753175.TPB.torrent

(basically, there is a URL that is a part of the URL but its been run through encodeURIComponent). (基本上,有一个URL是URL的一部分,但它是通过encodeURIComponent运行的)。 In this case, Apache is returning its own 404 page and not passing the url through to the backend server. 在这种情况下,Apache返回自己的404页面,而不是将url传递给后端服务器。

My apache config is as follows: 我的apache配置如下:

<VirtualHost *:80>
        ServerName m2t.openseedbox.com

        ProxyPass / http://127.0.0.1:3000/ retry=0
        ProxyPassReverse / http://127.0.0.1:3000/
        ProxyPreserveHost On
</VirtualHost>

Why is Apache not proxying this URL? 为什么Apache不代理此URL? (you can visit it yourself to see the Apache 404 page where a Bottle page should be) (您可以自己访问它以查看Apache 404页面应该是一个Bottle页面)

EDIT: I've worked around it by passing the URL as a GET parameter. 编辑:我通过将URL作为GET参数传递来解决它。 I still dont know why Apache isnt working as advertised though... 我仍然不知道为什么Apache不像宣传的那样工作......

By default, Apache doesn't pass through urls with %2F in them. 默认情况下,Apache不会传递包含%2F的URL。 See the link below for more info. 有关详细信息,请参阅以下链接。

%2F in URL breaks and does not reference to the .php file required URL中的%2F中断并且不引用所需的.php文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM