Merge lp:~allenap/maas/trailing-slash-optional into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 3473
Proposed branch: lp:~allenap/maas/trailing-slash-optional
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 118 lines (+47/-3)
2 files modified
contrib/maas-http.conf (+7/-1)
etc/apache.conf (+40/-2)
To merge this branch: bzr merge lp:~allenap/maas/trailing-slash-optional
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+246827@code.launchpad.net

Commit message

In Apache, redirect requests for /MAAS to /MAAS/.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) :
review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Thanks!

Revision history for this message
Christian Reis (kiko) wrote :

On Sat, Jan 17, 2015 at 06:47:22PM -0000, Gavin Panella wrote:
> Gavin Panella has proposed merging lp:~allenap/maas/trailing-slash-optional into lp:maas.
>
> Commit message:
> In Apache, redirect requests for /MAAS to /MAAS/.

Would it be too much to do the same for the lowercase variant, /maas[/]?
--
Christian Robottom Reis | [+1] 612 888 4935 | http://launchpad.net/~kiko
Canonical VP Hyperscale | [+55 16] 9 9112 6430

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'contrib/maas-http.conf'
--- contrib/maas-http.conf 2014-12-05 16:46:01 +0000
+++ contrib/maas-http.conf 2015-01-17 22:48:49 +0000
@@ -8,7 +8,7 @@
8</IfModule>8</IfModule>
99
10<IfModule mod_expires.c>10<IfModule mod_expires.c>
11 <Location /MAAS>11 <Location /MAAS/>
12 ExpiresActive On12 ExpiresActive On
13 ExpiresByType text/javascript "access plus 1 years"13 ExpiresByType text/javascript "access plus 1 years"
14 ExpiresByType application/javascript "access plus 1 years"14 ExpiresByType application/javascript "access plus 1 years"
@@ -29,3 +29,9 @@
29 ProxyPass /MAAS/static/ !29 ProxyPass /MAAS/static/ !
30 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=130 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=1
31</IfModule>31</IfModule>
32
33<IfModule rewrite_module>
34 RewriteEngine On
35 # Redirect (permanently) requests for /MAAS to /MAAS/.
36 RewriteRule ^/MAAS$ %{REQUEST_URI}/ [R=301,L]
37</IfModule>
3238
=== removed file 'etc/apache.conf'
--- etc/apache.conf 2014-09-23 19:09:47 +0000
+++ etc/apache.conf 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
1PidFile run/apache.pid
2
3Include /etc/apache2/mods-available/proxy.load
4Include /etc/apache2/mods-available/proxy.conf
5Include /etc/apache2/mods-available/proxy_http.load
6
7# The development server listens for http on port 5240, on all interfaces,
8# for both IPv4 and IPv6.
9Listen 5240
10
11ErrorLog /dev/stderr
12LogFormat "%h %l %u %t \"%r\" %>s %O" common
13CustomLog /dev/stdout common
14
15ProxyPreserveHost on
16
17# Proxy Django's dev server.
18ProxyPass / http://localhost:5243/ retry=1
190
=== renamed file 'etc/apache.saucy.conf' => 'etc/apache.conf'
--- etc/apache.saucy.conf 2014-11-06 14:08:21 +0000
+++ etc/apache.conf 2015-01-17 22:48:49 +0000
@@ -12,23 +12,61 @@
12Include /etc/apache2/mods-available/proxy_http.load12Include /etc/apache2/mods-available/proxy_http.load
13Include /etc/apache2/mods-available/alias.load13Include /etc/apache2/mods-available/alias.load
14Include /etc/apache2/mods-available/alias.conf14Include /etc/apache2/mods-available/alias.conf
15Include /etc/apache2/mods-available/expires.load
16Include /etc/apache2/mods-available/rewrite.load
17# mod_mime is required so that ExpiresByType works.
18Include /etc/apache2/mods-available/mime.load
19Include /etc/apache2/mods-available/mime.conf
1520
16# The development server listens for http on port 5240, on all interfaces,21# The development server listens for http on port 5240, on all interfaces,
17# for both IPv4 and IPv6.22# for both IPv4 and IPv6.
18Listen 524023Listen 5240
1924
25# Log to stdout/stderr.
20ErrorLog /dev/stderr26ErrorLog /dev/stderr
21LogFormat "%h %l %u %t \"%r\" %>s %O" common27LogFormat "%h %l %u %t \"%r\" %>s %O" common
22CustomLog /dev/stdout common28CustomLog /dev/stdout common
2329
24# Serve static files here.30#
31# The remainder of this file is derived from contrib/maas-http.conf, but
32# is not quite identical. Please update the configuration here when
33# changing maas-http.conf, paying careful attention to the differences.
34#
35
36<IfModule mod_ssl.c>
37 <VirtualHost *:443>
38 SSLEngine On
39 # Do not rely on these certificates, generate your own.
40 SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
41 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
42 </VirtualHost>
43</IfModule>
44
45<IfModule mod_expires.c>
46 <Location /MAAS/>
47 ExpiresActive On
48 ExpiresByType text/javascript "access plus 1 years"
49 ExpiresByType application/javascript "access plus 1 years"
50 ExpiresByType application/x-javascript "access plus 1 years"
51 ExpiresByType text/css "access plus 1 years"
52 ExpiresByType image/gif "access plus 1 years"
53 ExpiresByType image/jpeg "access plus 1 years"
54 ExpiresByType image/png "access plus 1 years"
55 </Location>
56</IfModule>
57
25<IfModule alias_module>58<IfModule alias_module>
26 Alias /MAAS/static/ src/maasserver/static/59 Alias /MAAS/static/ src/maasserver/static/
27</IfModule>60</IfModule>
2861
29# Proxy to maas-regiond.
30<IfModule proxy_module>62<IfModule proxy_module>
31 ProxyPreserveHost on63 ProxyPreserveHost on
32 ProxyPass /MAAS/static/ !64 ProxyPass /MAAS/static/ !
33 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=165 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=1
34</IfModule>66</IfModule>
67
68<IfModule rewrite_module>
69 RewriteEngine On
70 # Redirect (permanently) requests for /MAAS to /MAAS/.
71 RewriteRule ^/MAAS$ %{REQUEST_URI}/ [R=301,L]
72</IfModule>
3573
=== removed symlink 'etc/apache.trusty.conf'
=== target was u'apache.saucy.conf'
=== removed symlink 'etc/apache.utopic.conf'
=== target was u'apache.saucy.conf'