# Site down after enabling SSL

**URL:** https://meta.discourse.org/t/site-down-after-enabling-ssl/46778
**Category:** Self-hosting
**Created:** [July 3, 2016, 6:51pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778 "2016-07-03T18:51:40Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 6:51pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/1 "2016-07-03T18:51:41Z")

</div>

I bought a PositiveSSL from Namecheap today and followed the instructions at:

> [@Allow SSL / HTTPS for your Discourse Docker setup](https://meta.discourse.org/t/allowing-ssl-https-for-your-discourse-docker-setup/13847):
>
> This guide is likely out of date as there are now very few reasons not to use the built-in Let’s Encrypt certificate that Just Works. See also: 2023-04-10 @pfaffman says: This is left here mostly for historical purposes. So you’d like to enable SSL for your Docker-based Discourse setup? Let’s do it! This guide assumes you used all the [standard install](https://meta.discourse.org/t/142537?silent=true) defaults – a container configuration file at/var/discourse/containers/app.yml and Discourse docker is installed at: /var/discourse Buy a SS…

Which included placing ssl.key and ssl.crt at /var/discourse/shared/standalone/ssl/ and adding the additional templates to app.yml. I have set up the A record to point to the IP Address of the droplet/instance.

The site was running perfectly before on both Google Compute and then on Digital Ocean (for testing) but once I enabled SSL, it went down. If I type in [www.hostname.com](http://www.hostname.com) or the IP address, it resolves to [https://hostname.com](https://hostname.com) and gives a “Unable to connect” or “Server not found” error.

There are no errors in the logs. If someone can help, it would be massively appreciated. I have been going at this for 10 hours straight without any luck 😧

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [July 3, 2016, 6:55pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/2 "2016-07-03T18:55:03Z")

</div>

Can you post your `app.yml` here, without the credentials for SMTP?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 3, 2016, 7:01pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/3 "2016-07-03T19:01:00Z")

</div>

And do you have a non-www A record defined too?

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 7:01pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/4 "2016-07-03T19:01:54Z")

</div>

@cpradio I have 2 TXT records (one SPF and one DKIM for sending mail through Sparkpost) and 1 URL redirect record. However, everything was resolving nicely before the SSL change.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [July 3, 2016, 7:11pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/5 "2016-07-03T19:11:06Z")

</div>

Can you tell us which hostname your installation should be running at?

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 7:14pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/6 "2016-07-03T19:14:43Z")

</div>

@fefrei here are the screenshots:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/7/97515bfbec64112f27672b0bb31ab5d0eb4ec06c.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/b/4/b432ccd680fb4d9161bbd9d8ff640cbbf969cbca.png)

I was using Google Compute before. I have tried again with DO, but no luck..

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [July 3, 2016, 7:16pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/7 "2016-07-03T19:16:32Z")

</div>

You just pasted your sparkpost password :sadpanda:

Please change that password as immediately.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [July 3, 2016, 7:19pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/8 "2016-07-03T19:19:18Z")

</div>

In the meantime, it looks like @cpradio was right in suspecting a DNS problem. I get `SERVFAIL` when resolving your hostname – both with and without the WWW.

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 7:26pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/9 "2016-07-03T19:26:26Z")

</div>

@fefrei Oops have corrected it. Should I try re-issuing the certificate or should I try fixing the DNS records?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [July 3, 2016, 7:27pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/10 "2016-07-03T19:27:32Z")

</div>

DNS should be your first priority – as long as this is broken, your server doesn’t even have a chance to present any SSL certificate 🙂

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 7:31pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/11 "2016-07-03T19:31:21Z")

</div>

Hmm, the only A record I have is pointed to the DO droplet. I will try with Namecheap support and report back. Thank you guys!\

 ![](https://global.discourse-cdn.com/meta/original/3X/f/3/f3caad57307a2b802c8acc9a0e8d6915b5c8b935.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 3, 2016, 8:49pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/12 "2016-07-03T20:49:53Z")

</div>

I’m still wondering if your A Record is only handling `www.` What is the URL Redirect Record handling?

Because if the URL Redirect Record is redirecting to `https://yourhost.com`, and your A Record is only supporting `www.`, then you are correct that nothing knows how to support it.

I have 2 A records with my setup, one for non-www and one for www.

 ![](https://global.discourse-cdn.com/meta/original/3X/2/a/2a0d35d5886dd3ff95a09bf930135a3cc975ff4c.png)

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 3, 2016, 9:59pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/13 "2016-07-03T21:59:42Z")

</div>

@cpradio the URL redirect record is pointed to [http://www.hostname.com](http://www.hostname.com) (unmasked) and the host value is ‘@’. Is that ok?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 3, 2016, 10:06pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/14 "2016-07-03T22:06:15Z")

</div>

So you are trying to use HTTPS but are redirecting traffic to HTTP? That redirect will definitely need to be HTTPS if you want to enforce HTTPS.

Also, since you are using @, that should cover the second A record (I think, the one for non-www)

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 4, 2016, 11:00am UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/15 "2016-07-04T11:00:18Z")

</div>

@cpradio thanks but unfortunately thats not solving the issue. When I check the ssl certificate, it is not giving off any errors. Discourse is running from what I see in the logs, but it doesn’t show up on the hostname or IP.

One thing that I noticed was I don’t have these two files:  
/etc/nginx/conf.d/discourse.conf  
and  
/var/www/discourse/config/discourse.conf

Could that be connected?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 4, 2016, 12:53pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/16 "2016-07-04T12:53:59Z")

</div>

Wait, are you running other sites on the machine hosting Discourse too? If you aren’t, you don’t need web.socketed.template.yml, if you are, did you check the nginx configuration (or whatever HTTP server you are using) on the actual server to verify it is permitting HTTPS to pass through to Discourse?

> [@P16](#):
>
> One thing that I noticed was I don’t have these two files:  
> /etc/nginx/conf.d/discourse.conf and /var/www/discourse/config/discourse.conf

These would be inside the container. Did you run `./launcher enter app` before searching for those configuration files?

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 4, 2016, 4:36pm UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/17 "2016-07-04T16:36:05Z")

</div>

@cpradio no I am only running discourse and am not using the socket template. The strange thing is that my other domains work using the SSL with the exact same settings. I am trying with Namecheap support but its a weird bug - one SSL domain resolves using the same settings while another does not.

Thanks for your help!

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [July 5, 2016, 6:16am UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/18 "2016-07-05T06:16:44Z")

</div>

I solved the issue by removing the url redirect. The bare redirect was creating a loop due to nginx. Hope this helps someone in future.

A big thank you to @cpradio and @fefrei for their help!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 19, 2018, 5:48am UTC](https://meta.discourse.org/t/site-down-after-enabling-ssl/46778/19 "2018-12-19T05:48:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
