2

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?

Frigo
  • 1,709
  • 1
  • 14
  • 32
  • 1
    I’ve filed a [bug report](https://bz.apache.org/bugzilla/show_bug.cgi?id=58727) on this. – cdauth Dec 13 '15 at 12:26

2 Answers2

2

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.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • 1
    I added physical directories as well, but it does not show them either. – Frigo Sep 27 '12 at 09:16
  • mod_autoindex did show proxied paths as long as I had empty directories when using 2.2, but no longer with 2.4 – ptman Mar 24 '15 at 15:22
1

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.

Frigo
  • 1,709
  • 1
  • 14
  • 32