# Insecure fonts requests

**URL:** https://meta.discourse.org/t/insecure-fonts-requests/261118
**Category:** Support
**Created:** [April 9, 2023, 7:31pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118 "2023-04-09T19:31:44Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![silverdr](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@silverdr](https://meta.discourse.org/u/silverdr)
#### Post date: [April 9, 2023, 7:31pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/1 "2023-04-09T19:31:44Z")

</div>

```plaintext
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure font '<URL>'. This request has been blocked; the content must be served over HTTPS

```

And 40 requests for fonts from `discourse-fonts` gem. This is a fresh installation where Postgres and Redis is run on a separate server inside local network and the connection is “socketed” but served to the outside over https of course. There are [similar](https://meta.discourse.org/t/blocked-loading-mixed-active-content-issue-related-to-fonts/195711) [threads](https://meta.discourse.org/t/mixed-content-the-page-at-url-was-loaded-over-https-error/216404) but no clear answer to me. Checking CSS points to `wizard.scss` (source-mapped). Any clues?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 9, 2023, 11:04pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/2 "2023-04-09T23:04:56Z")

</div>

Did you enable the `force https` setting?

---

<div class="post-metadata">

### Author: ![silverdr](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@silverdr](https://meta.discourse.org/u/silverdr)
#### Post date: [April 10, 2023, 8:41am UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/3 "2023-04-10T08:41:26Z")

</div>

Most probably no. Where do I set it? And why should it be needed in the first place instead of having the CSS request static assets over https or [relative references](https://www.rfc-editor.org/rfc/rfc3986#section-4.2)?

FWIW - on the outside facing webserver I do have the typical 301 set

#### Edit:

Found the setting based on [this post](https://meta.discourse.org/t/mixed-content-problem/121837/7), thank you @Arkshine

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 10, 2023, 11:14am UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/4 "2023-04-10T11:14:30Z")

</div>

I’m unsure why you have an http link somewhere; https should be enforced regardless.

You can find in the search bar:

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/f/b/2fb3036648674205df32ff18accab9fb4b215903.png)

---

<div class="post-metadata">

### Author: ![silverdr](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@silverdr](https://meta.discourse.org/u/silverdr)
#### Post date: [April 10, 2023, 11:38am UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/5 "2023-04-10T11:38:07Z")

</div>

> [@Arkshine](#):
>
> I’m unsure why you have an http link somewhere

Well, me neither. I didn’t modify anything. Just the regular `launcher build app` These URLs seem to be in the processed CSS, which I obviously didn’t touch (nor the `scss`) in any way. I didn’t find anything https related in the app.yml either so.. don’t know. The `force_https` seem to work the problem around.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 10, 2023, 12:03pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/6 "2023-04-10T12:03:04Z")

</div>

`FORCE_HTTPS` tells Discourse to rewrite requests.

It’s necessary even if you’re doing ssl encapsulation outside the container to avoid the issue you’re describing.

---

<div class="post-metadata">

### Author: ![silverdr](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@silverdr](https://meta.discourse.org/u/silverdr)
#### Post date: [April 11, 2023, 1:02pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/7 "2023-04-11T13:02:47Z")

</div>

It depends how we define “necessary”. Currently it might be necessary to work around the actual problem, which is that compiled CSS files reference static assets explicitly using `http` schema. But IMHO this should not be necessary in the long run

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 11, 2023, 10:59pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/8 "2023-04-11T22:59:40Z")

</div>

Necessary as in it’s the purpose of FORCE\_HTTPS - that’s how you tell Discourse that it’s being served securely and to rewrite links as such.

---

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [April 28, 2023, 9:33am UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/9 "2023-04-28T09:33:18Z")

</div>

So what factors/conditions would impact the assets (JS/CSS) URL protocol HTTP/HTTPS?

1. If you comment out below, and your site access from HTTP, then assets URL will be HTTP as well

```plaintext
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"

```

In this case, if you enable `force_https` you will end up with all assets URL error `R_SSL_PROTOCOL_ERROR` if you requested domain doesn’t install certificate. Then to avoid that you install certificate for that to resolve the SSL protocol issue

1. If you instead install Discourse with above template uncommented, the site’s assets URL should be HTTPS along with your site base URL protocol. And more, the `force https` is invisible in admin UI.

---

<div class="post-metadata">

### Author: ![silverdr](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@silverdr](https://meta.discourse.org/u/silverdr)
#### Post date: [April 28, 2023, 11:04pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/10 "2023-04-28T23:04:01Z")

</div>

As mentioned in the original post, in my case certificate and everything is correct and valid but all connections to the outside are handled by a reverse-proxy (nginx, obviously ;-), while connection to discourse goes over unix socket. Meaning I have  
`templates/web.socketed.template.yml`  
rather than any of those you mention. Still - this should not need to cause static URLs have hardcoded explicit `http:` schema

---

<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: [May 28, 2023, 11:04pm UTC](https://meta.discourse.org/t/insecure-fonts-requests/261118/11 "2023-05-28T23:04:27Z")

</div>

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