From 82f385237aebc4ce1ba7e4ea5428d5ef40de3020 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 7 Sep 2013 14:54:14 -0400 Subject: [PATCH] Make UI always use https:// but API traffic that wants to can still get http:// --- config/awx-plain.conf | 19 ++++++++++++++++--- config/awx.conf | 1 - 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/awx-plain.conf b/config/awx-plain.conf index a5b4200022..1bb1dafbd9 100644 --- a/config/awx-plain.conf +++ b/config/awx-plain.conf @@ -1,12 +1,24 @@ +WSGISocketPrefix /var/run/wsgi + + + RewriteEngine On + # don't redirect HTTPs + RewriteCond %{HTTPS} off + # don't redirect /api traffic that requested explicit http:// + RewriteRule ^/api - [L] + RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + ServerName localhost ServerAlias localhost ServerAlias 127.0.0.1 DocumentRoot /var/lib/awx/public - RewriteEngine On - RewriteCond %{HTTPS} off - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + WSGIScriptAlias / /var/lib/awx/wsgi.py + WSGIPassAuthorization On + + WSGIDaemonProcess awx_plain user=awx group=awx processes=2 threads=20 maximum-requests=1000 display-name="%{GROUP}" + WSGIProcessGroup awx_plain Alias /favicon.ico /var/lib/awx/public/static/favicon.ico Alias /static/ /var/lib/awx/public/static/ @@ -23,4 +35,5 @@ Allow from all + diff --git a/config/awx.conf b/config/awx.conf index 63dba5295c..b9ae3c69e1 100644 --- a/config/awx.conf +++ b/config/awx.conf @@ -14,7 +14,6 @@ LoadModule ssl_module modules/mod_ssl.so WSGIScriptAlias / /var/lib/awx/wsgi.py WSGIPassAuthorization On - # FIXME: May want to tune these parameters after performance testing. WSGIDaemonProcess awx user=awx group=awx processes=2 threads=20 maximum-requests=1000 display-name="%{GROUP}" WSGIProcessGroup awx