简体   繁体   English

Apache中反向代理后面的目录列表

[英]Directory listing behind a reverse proxy in apache

I am trying to run a directory listing through a reverse proxy in apache. 我正在尝试通过apache中的反向代理运行目录列表。 Current OS is Ubuntu. 当前的操作系统是Ubuntu。 My issue is I can get to my directory listing just fine but opening any listed folder throws a 404. Here is my current configuration 我的问题是我可以进入目录列表,但是打开任何列出的文件夹都会抛出404。这是我当前的配置

ProxyRequests Off
ProxyPreserveHost on
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass /opendir http://192.168.1.7
ProxyPassReverse /opendir http://192.168.1.7
Header always unset X-Frame-Options

So an example of what's happening. 举个例子。 If I got to www.myserver.com/opendir I see the folders as expected. 如果访问www.myserver.com/opendir ,则可以看到预期的文件夹。 If I click on one of the folders it redirects me to www.myserver.com/folder_name and throws a 404. Not sure how to over come this. 如果单击其中一个文件夹,它会将我重定向到www.myserver.com/folder_name并抛出404。不知道该如何解决。

Simply adding a / to the directory names solved my issue 只需在目录名称中添加/即可解决我的问题

ProxyRequests Off
ProxyPreserveHost on
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass /opendir/ http://192.168.1.7/
ProxyPassReverse /opendir/ http://192.168.1.7/
Header always unset X-Frame-Options

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

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