Enable SSL in Discourse
NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.
First, configure Apache to enable SSL connections. Then, force HTTPS for all Discourse links using one of the following options:
-
Enable the following option in the Discourse site_settings.yml configuration file.
NOTE: Depending on your installation type, the Discourse site_settings.yml configuration file can be found in the following locations:
-
Approach A (Bitnami installations using system packages): installdir/discourse/config/site_settings.yml
-
Approach B (Self-contained Bitnami installations): installdir/apps/discourse/htdocs/config/site_settings.yml
security: force_https: default: true
NOTE: In older Discourse versions, the option name is use_ssl or use_https.
-
-
If the HTTPS port is not the standard port 443, update the HTTPS port entry in the database by following the steps below:
-
Log in to the server console.
-
Start the PostgreSQL command-line client and connect to the PostgreSQL database.
-
Execute the following SQL command, replacing the NEW_PORT placeholder with the number of the SSL port.
bitnami_discourse=# UPDATE site_settings SET value = 'NEW_PORT' WHERE name = 'port'
-
-
Disable HTTP and redirect all requests to HTTPS URLs.
-
Restart the server:
$ sudo installdir/ctlscript.sh restart