# How can I enable SSL while running on a different port + Issue with subdomain

**URL:** <https://meta.discourse.org/t/how-can-i-enable-ssl-while-running-on-a-different-port-issue-with-subdomain/44646>\
**Category:** Self-hosting\
**Created:** [23 مايو 2016، 2:52ص UTC](https://meta.discourse.org/t/how-can-i-enable-ssl-while-running-on-a-different-port-issue-with-subdomain/44646 "2016-05-23T02:52:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Daffy\_Chu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daffy_chu/32/64458_2.png) [@Daffy\_Chu](https://meta.discourse.org/u/Daffy_Chu)\
**Post date:** [23 مايو 2016، 2:52ص UTC](https://meta.discourse.org/t/how-can-i-enable-ssl-while-running-on-a-different-port-issue-with-subdomain/44646/1 "2016-05-23T02:52:53Z")

</div>

Hello,

Recently, I have just successfully installed this forum into my server machine. But instead of just running a single Discourse forum on the machine, I combined it with cpanel web host for running custom html for other contents that I need. So I followed the [How to set up Discourse on a server with existing Apache sites](https://meta.discourse.org/t/how-to-set-up-discourse-on-a-server-with-existing-apache-sites/30013) guide from the howto section. It works perfectly but the tutorial only provided with http with HAProxy. Then, I did a little research on getting SSL to work with HAProxy, it turned out its just pointing certificates in HAProxy. And Okay, that is solved, but here comes another problem, since I had to change the port in order for it to not conflict with each other, I decided to change Discourse’s app.yml from 443:443 to 4445:443 but whenever I rebuild the apps and tries to get into the site with that port, it doesn’t tend to want to load. (I also disabled the port 80:80 which I changed to 8888:80 (which works fine)) Lastly, the problem with my domain, since I’m using Cpanel, when I set the Cname community to point to my domain, I always get to the page Cpanel defaultpage where nothing could be found. I was wondering if it’s possible to have the subdomain point to the discourse forum instead of pointing in the folders.

The way I setup my subdomain for this purpose was (Since I use cloudflare for my dns) I setup a Cname of community pointing to my ipaddress of the machine, and usually I would create the subdomain in cpanel as well, but since I believe it will conflict each other, so I didn’t create a subdomain in cpanel with community.

* * *

To summarize my issues

- SSL Port not working when changed to something other than 443
- SubDomain not working due to Cpanel, even though I have the domain setup correctly

Here’s my discourse app.yml file, I have removed my domain and email w/ password for security

> <https://pastebin.com/95Auak28>

Here’s my HAProxy config

> <https://pastebin.com/JSmTHN8k>

Was wondering if anyone has tried this and succeed before (Cpanel w/ discourse and w/ SSL Enabled)

Any help would be appreciated, will try to reply ASAP

- DC

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-enable-ssl-while-running-on-a-different-port-issue-with-subdomain/44646)._
