BryanDavis has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/368213 )
Change subject: wmcs: Update tools-static reverse proxy rules for Google fonts
......................................................................
wmcs: Update tools-static reverse proxy rules for Google fonts
Follow up to 8dad3bde99 that adds support for additional URLs that we
missed in the original reverse-proxy setup.
Bug: T110027
Change-Id: Iea2cf526df9acb0bb166e6f385a747e793003407
---
M modules/toollabs/templates/static-server.conf.erb
1 file changed, 11 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/13/368213/1
diff --git a/modules/toollabs/templates/static-server.conf.erb
b/modules/toollabs/templates/static-server.conf.erb
index 16caa85..e98e7ea 100644
--- a/modules/toollabs/templates/static-server.conf.erb
+++ b/modules/toollabs/templates/static-server.conf.erb
@@ -55,6 +55,7 @@
return 302 "https://<%= @web_domain %>";
}
+ # Special handling for /cdnjs, our local cdnjs mirror
location = /cdnjs {
return 302 "https://<%= @web_domain %>/cdnjs/";
}
@@ -70,6 +71,7 @@
root /srv/; # Is ok, nginx ensures that this is /cdnjs/* only
}
+ # Special handling for /fontcdn, reverse proxy to google's fonts service
location = /fontcdn {
return 302 "https://<%= @web_domain %>/fontcdn/";
}
@@ -90,20 +92,24 @@
# rewrite is an action directive and does not inherit
- location ^~ /fontcdn/s/ {
- rewrite ^/fontcdn(/.*)$ $1 break;
- proxy_pass https://fonts.gstatic.com;
- }
-
+ # Proxy /fontcdn/css to fonts.googleapis.com
location ^~ /fontcdn/css {
rewrite ^/fontcdn(/.*)$ $1 break;
proxy_pass https://fonts.googleapis.com;
# subs_filter works only on uncompressed data
proxy_set_header Accept-Encoding "";
+
+ # Rewrite references to the upstream to point to our proxy
subs_filter_types text/css;
subs_filter '//fonts.gstatic.com/' '//$host/fontcdn/';
}
+
+ # Proxy anything else to fonts.gstatic.com
+ location ^~ /fontcdn/ {
+ rewrite ^/fontcdn(/.*)$ $1 break;
+ proxy_pass https://fonts.gstatic.com;
+ }
}
location ~ ^/([^/]+)(/.*)?$ {
--
To view, visit https://gerrit.wikimedia.org/r/368213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea2cf526df9acb0bb166e6f385a747e793003407
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits