diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index 8461162c54..97036b6880 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -33,9 +33,6 @@ - role: httpd/reverseproxy website: copr.fedoraproject.org destname: coprapi - localpath: /api - remotepath: /api - proxyurl: https://copr.fedorainfracloud.org when: env != "staging" tags: copr diff --git a/roles/httpd/redirect/templates/redirect.copr.conf b/roles/httpd/redirect/templates/redirect.copr.conf index bf485617c4..8bf42ed1d0 100644 --- a/roles/httpd/redirect/templates/redirect.copr.conf +++ b/roles/httpd/redirect/templates/redirect.copr.conf @@ -1,4 +1,3 @@ RewriteEngine on -RewriteCond %{REQUEST_URI} !^/api/* -RewriteCond %{REQUEST_URI} !^/api_2/* +RewriteCond %{REQUEST_URI} !^/api RewriteRule ^/(.*) https://copr.fedorainfracloud.org/$1 [L,R] diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.coprapi.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.coprapi.conf index 81546df23f..f44cfd73c8 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.coprapi.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.coprapi.conf @@ -11,5 +11,7 @@ RequestHeader set X-Scheme https early RequestHeader set X-Forwarded-Proto https early {% endif %} -ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}} -ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}} +{% for path in ('api', 'api_2', 'api_3') %} +ProxyPass /{{path}} https://copr.fedorainfracloud.org/{{path}} +ProxyPassReverse /{{path}} https://copr.fedorainfracloud.org/{{path}} +{% endfor %}