diff --git a/modules/openstack_project/templates/mirror.vhost.erb b/modules/openstack_project/templates/mirror.vhost.erb index b9dc6e9f42..4604ef7fdf 100644 --- a/modules/openstack_project/templates/mirror.vhost.erb +++ b/modules/openstack_project/templates/mirror.vhost.erb @@ -22,16 +22,20 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %> - # Pypi URL's are: - # /pypi/simple/a/a/a-etc.whl - # /pypi/simple/a/abcd/abcd-etc.whl - # /pypi/simple/a/abcde/abcde-etc.whl RewriteEngine On - RewriteRule ^/pypi/simple/([^/])([^/]*)$ /pypi/simple/$1/$1$2 [L] - RewriteRule ^/pypi/simple/([^/])([^/]*)/(.*)$ /pypi/simple/$1/$1$2/$3 [L] + + # Pypi's bandersnatch URL's are: + # /pypi/simple/index.html + # /pypi/simple/a/a/(index.html)? + # /pypi/simple/a/a/a-etc.whl + # /pypi/simple/a/abcd/(index.html)? + # /pypi/simple/a/abcd/abcd-etc.whl + RewriteCond %{REQUEST_URI} ^/pypi/simple/([^/])([^/]*) + RewriteCond %{DOCUMENT_ROOT}/pypi/simple/$1/$1$2 -d + RewriteRule ^/pypi/simple/([^/])([^/]*)(/.*)?$ /pypi/simple/$1/$1$2$3 [L] ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log LogLevel warn CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined ServerSignature Off - \ No newline at end of file +