Akosiaris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78937


Change subject: Some more etherpad-lite apache config tunings
......................................................................

Some more etherpad-lite apache config tunings

Use the suggested rewrite rules, and allow for ServerAliases

Change-Id: I53bb662eee482037b4e08a76dac5d77db836d971
---
M manifests/misc/etherpad.pp
M templates/apache/sites/etherpad_lite.wikimedia.org.erb
2 files changed, 44 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/78937/1

diff --git a/manifests/misc/etherpad.pp b/manifests/misc/etherpad.pp
index 87b6037..2560c01 100644
--- a/manifests/misc/etherpad.pp
+++ b/manifests/misc/etherpad.pp
@@ -64,6 +64,7 @@
                $etherpad_ssl_key = '/etc/ssl/private/ssl-cert-snakeoil.key'
        } else {
                $etherpad_host = 'etherpad.wikimedia.org'
+               $etherpad_serveraliases = 'epl.wikimedia.org'
                $etherpad_ssl_cert = '/etc/ssl/certs/star.wikimedia.org.pem'
                $etherpad_ssl_key = '/etc/ssl/private/star.wikimedia.org.key'
        }
diff --git a/templates/apache/sites/etherpad_lite.wikimedia.org.erb 
b/templates/apache/sites/etherpad_lite.wikimedia.org.erb
index 81228b7..f52858f 100644
--- a/templates/apache/sites/etherpad_lite.wikimedia.org.erb
+++ b/templates/apache/sites/etherpad_lite.wikimedia.org.erb
@@ -7,6 +7,10 @@
 <VirtualHost *:80>
 
        ServerName <%= etherpad_host %>
+       <% if etherpad_serveraliases -%>
+       ServerAlias <%= etherpad_serveraliases %>
+       <% end -%>
+
 
        RewriteEngine on
        ProxyVia On
@@ -14,7 +18,24 @@
        ProxyPass / http://<%= etherpad_ip %>:<%= etherpad_port %>/
        ProxyPassReverse / http://<%= etherpad_ip %>:<%= etherpad_port %>/
        ProxyPreserveHost On
-       RewriteRule     ^/([^/]+)$ /p/$1 [R=301,L]
+       RewriteRule /p/*$ https://etherpad.wikimedia.org/ [NC,L]
+       RewriteCond %{REQUEST_URI} !^/locales/
+       RewriteCond %{REQUEST_URI} !^/locales.json
+       RewriteCond %{REQUEST_URI} !^/admin
+       RewriteCond %{REQUEST_URI} !^/p/
+       RewriteCond %{REQUEST_URI} !^/static/
+       RewriteCond %{REQUEST_URI} !^/pluginfw/
+       RewriteCond %{REQUEST_URI} !^/javascripts/
+       RewriteCond %{REQUEST_URI} !^/socket.io/
+       RewriteCond %{REQUEST_URI} !^/ep/
+       RewriteCond %{REQUEST_URI} !^/minified/
+       RewriteCond %{REQUEST_URI} !^/api/
+       RewriteCond %{REQUEST_URI} !^/ro/
+       RewriteCond %{REQUEST_URI} !^/error/
+       RewriteCond %{REQUEST_URI} !^/jserror
+       RewriteCond %{REQUEST_URI} !/favicon.ico
+       RewriteCond %{REQUEST_URI} !/robots.txt
+       RewriteRule ^/+(.+)$ https://etherpad.wikimedia.org/p/$1 [L]
 
        <Proxy *>
                Options FollowSymLinks MultiViews
@@ -28,6 +49,9 @@
 <VirtualHost *:443>
 
        ServerName <%= etherpad_host %>
+       <% if etherpad_serveraliases -%>
+       ServerAlias <%= etherpad_serveraliases %>
+       <% end -%>
 
        SSLEngine on
        SSLProtocol -ALL +SSLv3 +TLSv1
@@ -42,7 +66,24 @@
        ProxyPass / http://<%= etherpad_ip %>:<%= etherpad_port %>/
        ProxyPassReverse / http://<%= etherpad_ip %>:<%= etherpad_port %>/
        ProxyPreserveHost On
-       RewriteRule     ^/([^/]+)$ /p/$1 [R=301,L]
+       RewriteRule /p/*$ https://etherpad.wikimedia.org/ [NC,L]
+       RewriteCond %{REQUEST_URI} !^/locales/
+       RewriteCond %{REQUEST_URI} !^/locales.json
+       RewriteCond %{REQUEST_URI} !^/admin
+       RewriteCond %{REQUEST_URI} !^/p/
+       RewriteCond %{REQUEST_URI} !^/static/
+       RewriteCond %{REQUEST_URI} !^/pluginfw/
+       RewriteCond %{REQUEST_URI} !^/javascripts/
+       RewriteCond %{REQUEST_URI} !^/socket.io/
+       RewriteCond %{REQUEST_URI} !^/ep/
+       RewriteCond %{REQUEST_URI} !^/minified/
+       RewriteCond %{REQUEST_URI} !^/api/
+       RewriteCond %{REQUEST_URI} !^/ro/
+       RewriteCond %{REQUEST_URI} !^/error/
+       RewriteCond %{REQUEST_URI} !^/jserror
+       RewriteCond %{REQUEST_URI} !/favicon.ico
+       RewriteCond %{REQUEST_URI} !/robots.txt
+       RewriteRule ^/+(.+)$ https://etherpad.wikimedia.org/p/$1 [L]
 
        <Proxy *>
                Options FollowSymLinks MultiViews

-- 
To view, visit https://gerrit.wikimedia.org/r/78937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I53bb662eee482037b4e08a76dac5d77db836d971
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Akosiaris <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to