# Http logo urls after enabling LetsEncrypt

**URL:** <https://meta.discourse.org/t/http-logo-urls-after-enabling-letsencrypt/108261>\
**Category:** Self-hosting\
**Created:** [February 3, 2019, 8:12pm UTC](https://meta.discourse.org/t/http-logo-urls-after-enabling-letsencrypt/108261 "2019-02-03T20:12:54Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![dovydasm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dovydasm/32/141073_2.png) [@dovydasm](https://meta.discourse.org/u/dovydasm)\
**Post date:** [May 19, 2019, 7:16pm UTC](https://meta.discourse.org/t/http-logo-urls-after-enabling-letsencrypt/108261/13 "2019-05-19T19:16:15Z")

</div>

I tried a a fresh install on a new vps, but it broke again after importing data. After lots of googling and going through source code, I found out my Discourse.BaseUrl had port 80 forced into it. I tracked it down to these lines in discourse.rb:

```ruby
 default_port = SiteSetting.force_https? ? 443 : 80
 url = +"#{base_protocol}://#{current_hostname}"
 url << ":#{SiteSetting.port}" if SiteSetting.port.to_i > 0 && SiteSetting.port.to_i != default_port

```

As a temporary fix, I commented out the last line, rebaked all the posts and that fixed everything for me.

Then I looked at my sql dump from the previous site export, and found out that `port` was set to `80` in `site_settings` (as I’ve mentioned, the original install didn’t have SSL). It didn’t match the port 443 which is expected from a site with force\_ssl, and 80 was inserted into BaseUrl. So, I guess the proper fix is to change SiteSetting.port to 443 and then rebake.

---

_[View the full topic](https://meta.discourse.org/t/http-logo-urls-after-enabling-letsencrypt/108261)._
