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
1=== modified file 'contrib/maas-http.conf'
2--- contrib/maas-http.conf 2014-12-05 16:46:01 +0000
3+++ contrib/maas-http.conf 2015-01-17 22:48:49 +0000
4@@ -8,7 +8,7 @@
5 </IfModule>
6
7 <IfModule mod_expires.c>
8- <Location /MAAS>
9+ <Location /MAAS/>
10 ExpiresActive On
11 ExpiresByType text/javascript "access plus 1 years"
12 ExpiresByType application/javascript "access plus 1 years"
13@@ -29,3 +29,9 @@
14 ProxyPass /MAAS/static/ !
15 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=1
16 </IfModule>
17+
18+<IfModule rewrite_module>
19+ RewriteEngine On
20+ # Redirect (permanently) requests for /MAAS to /MAAS/.
21+ RewriteRule ^/MAAS$ %{REQUEST_URI}/ [R=301,L]
22+</IfModule>
23
24=== removed file 'etc/apache.conf'
25--- etc/apache.conf 2014-09-23 19:09:47 +0000
26+++ etc/apache.conf 1970-01-01 00:00:00 +0000
27@@ -1,18 +0,0 @@
28-PidFile run/apache.pid
29-
30-Include /etc/apache2/mods-available/proxy.load
31-Include /etc/apache2/mods-available/proxy.conf
32-Include /etc/apache2/mods-available/proxy_http.load
33-
34-# The development server listens for http on port 5240, on all interfaces,
35-# for both IPv4 and IPv6.
36-Listen 5240
37-
38-ErrorLog /dev/stderr
39-LogFormat "%h %l %u %t \"%r\" %>s %O" common
40-CustomLog /dev/stdout common
41-
42-ProxyPreserveHost on
43-
44-# Proxy Django's dev server.
45-ProxyPass / http://localhost:5243/ retry=1
46
47=== renamed file 'etc/apache.saucy.conf' => 'etc/apache.conf'
48--- etc/apache.saucy.conf 2014-11-06 14:08:21 +0000
49+++ etc/apache.conf 2015-01-17 22:48:49 +0000
50@@ -12,23 +12,61 @@
51 Include /etc/apache2/mods-available/proxy_http.load
52 Include /etc/apache2/mods-available/alias.load
53 Include /etc/apache2/mods-available/alias.conf
54+Include /etc/apache2/mods-available/expires.load
55+Include /etc/apache2/mods-available/rewrite.load
56+# mod_mime is required so that ExpiresByType works.
57+Include /etc/apache2/mods-available/mime.load
58+Include /etc/apache2/mods-available/mime.conf
59
60 # The development server listens for http on port 5240, on all interfaces,
61 # for both IPv4 and IPv6.
62 Listen 5240
63
64+# Log to stdout/stderr.
65 ErrorLog /dev/stderr
66 LogFormat "%h %l %u %t \"%r\" %>s %O" common
67 CustomLog /dev/stdout common
68
69-# Serve static files here.
70+#
71+# The remainder of this file is derived from contrib/maas-http.conf, but
72+# is not quite identical. Please update the configuration here when
73+# changing maas-http.conf, paying careful attention to the differences.
74+#
75+
76+<IfModule mod_ssl.c>
77+ <VirtualHost *:443>
78+ SSLEngine On
79+ # Do not rely on these certificates, generate your own.
80+ SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
81+ SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
82+ </VirtualHost>
83+</IfModule>
84+
85+<IfModule mod_expires.c>
86+ <Location /MAAS/>
87+ ExpiresActive On
88+ ExpiresByType text/javascript "access plus 1 years"
89+ ExpiresByType application/javascript "access plus 1 years"
90+ ExpiresByType application/x-javascript "access plus 1 years"
91+ ExpiresByType text/css "access plus 1 years"
92+ ExpiresByType image/gif "access plus 1 years"
93+ ExpiresByType image/jpeg "access plus 1 years"
94+ ExpiresByType image/png "access plus 1 years"
95+ </Location>
96+</IfModule>
97+
98 <IfModule alias_module>
99 Alias /MAAS/static/ src/maasserver/static/
100 </IfModule>
101
102-# Proxy to maas-regiond.
103 <IfModule proxy_module>
104 ProxyPreserveHost on
105 ProxyPass /MAAS/static/ !
106 ProxyPass /MAAS/ http://localhost:5243/MAAS/ retry=1
107 </IfModule>
108+
109+<IfModule rewrite_module>
110+ RewriteEngine On
111+ # Redirect (permanently) requests for /MAAS to /MAAS/.
112+ RewriteRule ^/MAAS$ %{REQUEST_URI}/ [R=301,L]
113+</IfModule>
114
115=== removed symlink 'etc/apache.trusty.conf'
116=== target was u'apache.saucy.conf'
117=== removed symlink 'etc/apache.utopic.conf'
118=== target was u'apache.saucy.conf'