diff --git a/modules/openstack_project/templates/mirror.vhost.erb b/modules/openstack_project/templates/mirror.vhost.erb index 7467b0f1b3..9e7452e21f 100644 --- a/modules/openstack_project/templates/mirror.vhost.erb +++ b/modules/openstack_project/templates/mirror.vhost.erb @@ -42,21 +42,20 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %> RewriteCond %{DOCUMENT_ROOT}/wheel/$1/$2/$2$3 -d RewriteRule ^/wheel/([^/]+)/([^/])([^/]*)(/.*)?$ /wheel/$1/$2/$2$3$4 [L] - /npm/> + # npm's URL's are: + # /npm/-/index.json + # /npm/a/aabc/index.json + # /npm/a/aabc/latest/index.json + # /npm/a/aabc/-/aabc-0.0.0.tgz + RewriteCond %{REQUEST_URI} ^/npm/([^/])([^/]*) + RewriteCond %{DOCUMENT_ROOT}/npm/$1/$1$2 -d + RewriteRule ^/npm/([^/])([^/]*)(/.*)?$ /npm/$1/$1$2$3 [L] + + \/npm\/[^/]+\/.*"> DirectoryIndex index.json - - # npm's URL's are: - # /npm/-/index.json - # /npm/a/aabc/index.json - # /npm/a/aabc/latest/index.json - # /npm/a/aabc/-/aabc-0.0.0.tgz - RewriteCond %{REQUEST_URI} ^/npm/([^/])([^/]*) - RewriteCond %{DOCUMENT_ROOT}/npm/$1/$1$2 -d - RewriteRule ^([^/])([^/]*)(/.*)?$ $1/$1$2$3 [L] - AddOutputFilterByType SUBSTITUTE application/json Substitute "s|http://localhost|http://<%= @srvname %>/npm|ni" - + ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log LogLevel warn