aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/environment.rb8
-rw-r--r--config/general-example5
2 files changed, 11 insertions, 2 deletions
diff --git a/config/environment.rb b/config/environment.rb
index 5b632471e..e02a11e49 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -96,7 +96,13 @@ ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN",
# So that javascript assets use full URL, so proxied admin URLs read javascript OK
if (MySociety::Config.get("DOMAIN", "") != "")
- ActionController::Base.asset_host = MySociety::Config.get("DOMAIN", 'localhost:3000')
+ ActionController::Base.asset_host = Proc.new { |source, request|
+ if request.ssl? # for mySociety proxying
+ MySociety::Config.get("ADMIN_PUBLIC_URL", "/")
+ else
+ MySociety::Config.get("DOMAIN", 'localhost:3000')
+ end
+ }
end
# Load monkey patches from lib/
diff --git a/config/general-example b/config/general-example
index bc8e03f65..8b36ef9c8 100644
--- a/config/general-example
+++ b/config/general-example
@@ -38,7 +38,10 @@ define('OPTION_BLACKHOLE_PREFIX', 'do-not-reply-to-this-address'); // used as en
// Administration
define('OPTION_CONTACT_EMAIL', 'admin@localhost');
define('OPTION_ADMIN_BASE_URL', '/admin/');
-define('OPTION_ADMIN_PUBLIC_URL', '/'); // where /stylesheets sits under for admin pages
+// Where /stylesheets sits under for pages served over SSL, see asset_host in
+// config/environment.rb. This is to serve the stylesheets from SSL as well in
+// mySociety's proxied admin system.
+define('OPTION_ADMIN_PUBLIC_URL', '/');
// Secret key for signing cookie_store sessions
define('OPTION_COOKIE_STORE_SESSION_SECRET', 'your secret key here, make it long and random');