You should define DISCOURSE_FORCE_HTTPS to true or set that setting in your system settings.
DISCOURSE_FORCE_HTTPS