← Back to team overview

wordpress-charmers team mailing list archive

[Merge] ~tcuthbert/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master into ~wordpress-charmers/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master

 

Thomas Cuthbert has proposed merging ~tcuthbert/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master into ~wordpress-charmers/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master.

Commit message:
We need to proxy the wp-content URLs to swift via apache mod_proxy_http.

Requested reviews:
  Barry Price (barryprice)
  Canonical IS Reviewers (canonical-is-reviewers)

For more details, see:
https://code.launchpad.net/~tcuthbert/charm-k8s-wordpress/+git/wordpress-k8s-image-builder/+merge/382913
-- 
Your team Wordpress Charmers is subscribed to branch ~wordpress-charmers/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master.
diff --git a/Dockerfile b/Dockerfile
index 2f08cce..e58cfac 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -34,6 +34,8 @@ COPY ./files/docker-php.conf $APACHE_CONFDIR/conf-available/docker-php.conf
 RUN a2enconf docker-php \
     && a2dismod mpm_event \
     && a2enmod mpm_prefork \
+    && a2enmod proxy \
+    && a2enmod proxy_http \
     && a2enmod rewrite
 
 # Install the main Wordpress code, this will be our only site so /var/www/html is fine
diff --git a/files/docker-php.conf b/files/docker-php.conf
index 283d871..f32d064 100644
--- a/files/docker-php.conf
+++ b/files/docker-php.conf
@@ -1,3 +1,5 @@
+PassEnv SWIFT_URL
+
 <FilesMatch \.php$>
 	SetHandler application/x-httpd-php
 </FilesMatch>
@@ -15,3 +17,6 @@ DirectoryIndex index.php index.html
 	RewriteCond %{REQUEST_FILENAME} !-d
 	RewriteRule . /index.php [L]
 </Directory>
+
+ProxyPass /wp-content/uploads/ ${SWIFT_URL}
+ProxyPassReverse /wp-content/uploads/ ${SWIFT_URL}

References