Merge lp:~cjohnston/uci-engine/webui-apache-vhost-staging into lp:uci-engine

Proposed by Chris Johnston
Status: Rejected
Rejected by: Evan
Proposed branch: lp:~cjohnston/uci-engine/webui-apache-vhost-staging
Merge into: lp:uci-engine
Diff against target: 21 lines (+6/-6)
1 file modified
juju-deployer/configs/webui_http_vhost (+6/-6)
To merge this branch: bzr merge lp:~cjohnston/uci-engine/webui-apache-vhost-staging
Reviewer Review Type Date Requested Status
Evan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+222883@code.launchpad.net

Commit message

Fix 500 error for TS urls in staging.

Description of the change

Currently in staging we are still seeing a 500 error when trying to access the TS urls.. This fixes the issue for staging per IS' suggestions, however, development is broken with this and will come in a separate MP.

To post a comment you must log in.
Revision history for this message
David Lawson (deej) wrote :

Django is expecting a host header matching the allowed_hosts setting, which the ProxyPreserveHosts option to Apache provides. In situations without real DNS names, as in development, this will break things unless allowed_hosts has the IP of the Apache unit in it.

As far as swapping out mod_rewrite for mod_proxy, mod_proxy more nearly accomplishes what you appear to be trying to do, mapping URL space on the local server to a URL space on a remote server. ProxyPass and/or ProxyPassMatch is generally the way to go about this, ProxyPassReverse only applies to rewrites passed back from the server you're proxying to, so it wont accomplish much, if anything, without a matching ProxyPass stanza. The proxy module is also, frankly, much simpler to use.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:559
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/839/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/839/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andy Doan (doanac) wrote :

Comment inline.

>Django is expecting a host header matching the allowed_hosts setting, which the ProxyPreserveHosts option to Apache provides. In situations without real DNS names, as in development, this will break things unless allowed_hosts has the IP of the Apache unit in it.

Does this mean we can only have things work in staging or have things work in production? I/S uses the deploy.py script to build things and then add their special sauce. It feels like we should provide a file that works in development, and they could update this file when generating their special sauce to make this work in production?

Revision history for this message
Chris Johnston (cjohnston) wrote :

> >Django is expecting a host header matching the allowed_hosts setting, which
> the ProxyPreserveHosts option to Apache provides. In situations without real
> DNS names, as in development, this will break things unless allowed_hosts has
> the IP of the Apache unit in it.
>
> Does this mean we can only have things work in staging or have things work in
> production? I/S uses the deploy.py script to build things and then add their
> special sauce. It feels like we should provide a file that works in
> development, and they could update this file when generating their special
> sauce to make this work in production?

I am going to add the Apache instance info to allowed_hosts so that it works in dev.

Revision history for this message
Chris Johnston (cjohnston) :
Revision history for this message
David Lawson (deej) wrote :

Yeah, if there's an addition to the Django settings file to set the IP of the Apache unit in allowed_hosts it'll work in dev as well.

560. By Chris Johnston

Move apache include to before Proxy stuff per review

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:560
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/861/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/861/rebuild

review: Approve (continuous-integration)
Revision history for this message
Evan (ev) wrote :

Thanks for sorting out that remaining issue, Chris. This looks good.

review: Approve

Unmerged revisions

560. By Chris Johnston

Move apache include to before Proxy stuff per review

559. By Chris Johnston

Update webui apache vhost to work properly for staging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'juju-deployer/configs/webui_http_vhost'
2--- juju-deployer/configs/webui_http_vhost 2014-06-09 16:30:51 +0000
3+++ juju-deployer/configs/webui_http_vhost 2014-06-13 13:10:09 +0000
4@@ -27,11 +27,11 @@
5 Allow from all
6 </Directory>
7
8- RewriteEngine on
9 Include /etc/apache2/juju-*.conf
10- RewriteRule ^/api/(.*)$ http://{{ ciairlinetsdjango }}/api/$1 [P]
11- RewriteRule ^/gk/api/(.*)$ http://{{ ciairlinegatekeeperrestish }}/api/$1 [P]
12- RewriteCond %{REQUEST_URI} !^/static/
13- RewriteRule ^/(.*)$ http://{{ ciairlinewebuidjango }}/$1 [P]
14- ProxyPassReverse / http://{{ ciairlinetsdjango }}/
15+
16+ ProxyPreserveHost On
17+ ProxyPass /api/ http://{{ ciairlinetsdjango }}/api/
18+ ProxyPass /gk/api/ http://{{ ciairlinegatekeeperrestish }}/api/
19+ ProxyPass /static/ !
20+ ProxyPass / http://{{ ciairlinewebuidjango }}/
21 </VirtualHost>

Subscribers

People subscribed via source and target branches