I have Discourse running using the Standard Container, using Apache to proxy connections to Discourse. This allows you to have Discourse running along side other Apache Virtualhosts. You can do SSL in this way, using Server Name Indication.
Adjust the ports that are exposed by Docker (
## which TCP/IP ports should this container expose?
- "8080:80" # fwd host port 8080 to container port 80 (http)
- "2222:22" # fwd host port 2222 to container port 22 (ssh)
So Discourse will accept connections on port 8080 instead of 80.
Create a new VirtualHost configuration file for your Discourse install. Here’s what mine looks like:
# Redirect http connections to https...
Redirect 301 / https://discourse.example.com/
# Proxy to discourse for https connections
# SSL Configuration
SSLProtocol All -SSLv2 -SSLv3
# Certificate files to use
# Proxy to Discourse
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
In this setup, Apache is responsible for SSL. Discourse just sees regular incoming connections. The potential problem with this kind of setup is that Server Name Indication needs to be supported on the client, or SSL won’t work. The advantage is you can just use the same Apache you are using to host other websites, without another layer of nginx/whatever.