mod_autoindex hides directories used for mod_proxy

824 views Asked by At

I did set up two proxies using mod_proxy. However when I list all the directories in the root with mod_autoindex, it does not show the otherwise existent and empty dummy directories with the same name as the proxies, not even if I use ShowForbidden.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyPass /jenkins/ http://localhost:8080/jenkins/
ProxyPassReverse /jenkins/ http://localhost:8080/jenkins/

ProxyPass /redmine/ http://localhost:81/redmine/
ProxyPassReverse /redmine/ http://localhost:81/redmine/

<Directory />
    AllowOverride All
    Order Allow,Deny
    Allow from All
    Options -ExecCGI +FollowSymLinks +IncludesNOEXEC +Indexes +MultiViews -SymLinksIfOwnerMatch
    IndexOptions Charset=UTF-8 Type=text/html DescriptionWidth=* FancyIndexing FoldersFirst HTMLTable IconsAreLinks IgnoreCase NameWidth=* ShowForbidden VersionSort XHTML
</Directory>

Is there any way to force mod_autoindex to show these directories, and therefore the links to proxies?

2

There are 2 answers

0
Frigo On BEST ANSWER

Well, the least messy solution I managed is to just create a /jenkins_/ directory and redirect it to /jenkins/ with mod_rewrite.

RewriteEngine on
RewriteBase /jenkins_/
RewriteRule ^(.*)$ /jenkins/$1 [R]

It isn't exactly what I wanted but close.

2
Jon Lin On

There's no way for autoindex to show you URI's that are either defined by reverse proxies or aliases or something similar. A requested URI goes through the URI-to-file mapping pipeline, a bunch of modules get applied and at the end you end up with a response with (hopefully) content served. Mod_autoindex only looks at the physical files in the directory that ends up at the end of the URI-to-file processing pipeline, so anything that you've aliased or defined as a reverse proxy won't show up in that auto indexed list because they're not physical files/directories on the filesystem.

I don't think there's a painless way to get auto indexed directory listings to also include aliases or reverse proxies. The more painful way is to write a custom script to generate the index listing and to include your custom aliases and reverse proxies.