Change the Base URL to https


Silverstripe Version:4.0

I am using SIlverstripe behind an AWS ALB which works for the main HTML page but the tag contains a http:// address instead of https://.
Therefore all of the JS and CSS are being served over HTTP and Chrome is throwing all sorts of errors.
How do I change this base tag to point to the https:// url? Is this done in nginx?


The best way I have found to work around this is to do the following -

  1. Set an environment variable for SS_BASE_URL, so in your .env file or server environment settings you can add -

  2. Then in your sites _config yml files (mine is in mysite.yml) you can add the following -

       alternate_base_url: '`SS_BASE_URL`'

This will then force SS to use that https domain for all possible link generation etc.