# Using Cloudflare for HTTPS, empty preview pane in edit page

**URL:** https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146
**Category:** Support
**Created:** [August 31, 2017, 2:26pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146 "2017-08-31T14:26:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 2:26pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/1 "2017-08-31T14:26:23Z")

</div>

In my new Discourse install, I have a problem I never had before: Le right div of text edit section rest always blank, not update the text in left section:

 ![Capture du 2017-08-31 16-23-49](https://global.discourse-cdn.com/meta/original/3X/0/f/0fca9719e8de5d2d3f70fe062510fcd382cf463a.png)

And that the case for Chrome and firefox, for every user…

Version v1.9.0.beta7 +174, installed yesterday by the common docker way. Just change a few color text, try the signature plugin and removed it.  
Any ideas ?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 31, 2017, 2:30pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/2 "2017-08-31T14:30:58Z")

</div>

See [Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 2:34pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/3 "2017-08-31T14:34:43Z")

</div>

Same thing in [safe mode](https://meta.discourse.org/t/53504?silent=true), with 3 options disabled…

---

<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: [August 31, 2017, 2:45pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/4 "2017-08-31T14:45:59Z")

</div>

If you open Dev Tools (F12), what errors do you see?

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 2:50pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/5 "2017-08-31T14:50:08Z")

</div>

This is what I see in debug tools:

```
"DEBUG: For more advanced debugging, install the Ember Inspector from https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/" ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:9:330
Blocked loading mixed active content “http://forum.exemple.com/assets/markdown-it-bundle-91aeb6600f2162d2794f12418867fef862f49ea60a788ebe93b131e36535bd08.js”[Learn More] ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:3:16846
Loading failed for the <script> with source “http://forum.exemple.com/assets/markdown-it-bundle-91aeb6600f2162d2794f12418867fef862f49ea60a788ebe93b131e36535bd08.js”. 64:1
s@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:14:27536
o@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:14:27393
i@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:14:27322
trigger@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:19:4711
_onError/<@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:19:6692
invokeWithOnError@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:7:17919
flush@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:7:18364
flush@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:7:19124
end@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:7:19469
run@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:7:20538
u@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:13:1629
e/i.error@https://forum.exemple.com/assets/application-0506907a0f8a422ad6c1ca3be9f4ab642422bf7a74f2dc2eb6e2f576685ce71e.js:1:32877
l@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:2:6359
fireWith@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:2:7127
r@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:3:10013
n@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:3:16810
dispatch@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:2:16565
add/v.handle@https://forum.exemple.com/assets/ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:2:14665
  ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:11:28887
XML Parsing Error: syntax error
Location: https://forum.exemple.com/logs/report_js_error
Line Number 1, Column 1:

```

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 2:52pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/6 "2017-08-31T14:52:53Z")

</div>

Hum when I try to Reply you with the console debug text:  
“Askimet has temporaly hidden your post”  
Waiting for moderator action …

But the main error is:

```
Blocked loading mixed active content “http://forum.exemple.com/assets/markdown-it-bundle-91aeb6600f2162d2794f12418867fef862f49ea60a788ebe93b131e36535bd08.js”[Learn More] ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:3:16846
Loading failed for the <script> with source “http://forum.exemple.com/assets/markdown-it-bundle-91aeb6600f2162d2794f12418867fef862f49ea60a788ebe93b131e36535bd08.js”.

```

And at the end:

```
XML Parsing Error: syntax error
Location: https://forum.exemple.com/logs/report_js_error
Line Number 1, Column 1:

```

---

<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: [August 31, 2017, 2:58pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/7 "2017-08-31T14:58:47Z")

</div>

Is your site HTTPS? Do you have force\_https enabled? (Admin \> Site Settings)

Are you using the Privacy Badger Extension in Chrome/Firefox (there have been reported issues with it in the past)?

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 3:09pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/8 "2017-08-31T15:09:22Z")

</div>

I’m using https yes, CloudFlare certificate and page rule https redirect.  
I don’t find in the admin the “force\_https” setting you told me. And we don’t use “Privacy Badger Extension”

Olso i’m using socket connection instead expose ports in my .yml file, nginx in reverse proxy.

---

<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: [August 31, 2017, 3:20pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/9 "2017-08-31T15:20:41Z")

</div>

> [@pokapow](#):
>
> Olso i’m using socket connection instead expose ports in my .yml file, nginx in reverse proxy.

Oh that changes things. Are you terminating the HTTPS at the nginx level or passing it through? As enabling `force https` could make things worse if you are not passing that through properly through your reverse proxy.

> [@pokapow](#):
>
> I don’t find in the admin the “force\_https” setting you told me

Sorry, that is the code version, search would take `force https`

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 3:28pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/10 "2017-08-31T15:28:18Z")

</div>

This is my nginx config:

```
server {
    listen 80;
    server_name forum.exemple.com;

    location / {

        proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        auth_basic "Staff only";
        auth_basic_user_file /etc/nginx/.htpasswd/.htpasswd-staff;

    }

    access_log /var/log/nginx/forum_access.log;
    error_log /var/log/nginx/forum_error.log;
}

```

The thing is, it’s CloudFlare who make the https redirect rules. So I have to listen the port 80 in nginx, else it doesn’t work…  
The case “Force https” is not active in admin. Should I ?

---

<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: [August 31, 2017, 3:32pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/11 "2017-08-31T15:32:43Z")

</div>

> [@pokapow](#):
>
> The case “Force https” is not active in admin. Should I ?

I wouldn’t yet. As it seems you are terminating HTTPS after cloudflare. But I’m trying to research this, as this is a bit out of my area of expertise, so I’m doing some searches here to see what else was suggested.

And when that setting is enabled and shouldn’t be, it makes things drastically difficult to fix (you have to SSH in and change the setting via the Rails Console)

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 3:41pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/12 "2017-08-31T15:41:41Z")

</div>

> [@cpradio](#):
>
> And when that setting is enabled and shouldn’t be, it makes things drastically difficult to fix (you have to SSH in and change the setting via the Rails Console)

Oh ok … Of course I’m on my server in ssh, but I don’t know the Rails console. Thank you to help us to debug this …  
My CloudFlare SSL is in “Flexible” mode. Maybe show I try in “Strict” mode ? But in this case I have to do it at night cause we have big traffic actually on this domain, and that could take several hours to change the cloudflare certificate … And I probably should change my nginx configs.

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 4:01pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/13 "2017-08-31T16:01:31Z")

</div>

And I confirme the problem is the https redirection, I just disabled the force https rule in CloudFlare, and tried the forum in http, and that work!  
I think I have to change the certificate to Strict mode… Cause if I make a return 301 https in nginx now, I have a redirect loop …

> <https://serverfault.com/questions/653976/redirect-loop-using-cloudflares-flexible-ssl>

So if I realy want to use nginx for force https redirect, I have to do it this way:

```
if ($http_x_forwarded_proto = "http") {
     return 301 https://$server_name$request_uri;
}

```

And that’s ok, but still have the same problem in discourse edit page …

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 4:31pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/14 "2017-08-31T16:31:58Z")

</div>

I think I could active the “Force https” in discourse, what do you think ?  
In fact every thing work in https mod actualy …

If I have problem to access the forum with force https, is a tutorial to change it in Rails console exist ? ^^

---

<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: [August 31, 2017, 4:52pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/15 "2017-08-31T16:52:18Z")

</div>

Go for it, if it fails, do the following:

SSH into box, run

```plaintext
/var/discourse/launcher enter app
rails c
SiteSetting.force_https = false

```

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 4:55pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/16 "2017-08-31T16:55:57Z")

</div>

Ok so I just active Force https, but still have the same problem …  
Should I rebuild or restart discourse to apply the change ? I don’t think so …  
The strange think is I still have the same error in console debug mode in firefox

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [August 31, 2017, 5:48pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/17 "2017-08-31T17:48:50Z")

</div>

Also I noticed a bug due to the Force https activation: The bouton for accepte invitation doesn’t work anymore!

 ![Clipboard - 31 août 2017 19_07](https://global.discourse-cdn.com/meta/original/3X/c/4/c4ec3f0333ee897eae570d400c1bcb0f5d5ab5c8.png)

And when disconnected and try to reconnect, we were redirect to the login page. Impossible to connect!  
Only this warning then:

```
GET http://forum.exemple.com/ [Mixed Content] [HTTP/1.1 301 Moved Permanently 200ms]
GET http://forum.exemple.com/login [Mixed Content] [HTTP/1.1 301 Moved Permanently 0ms]

"DEBUG: For more advanced debugging, install the Ember Inspector from https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/" ember_jquery-a8dcbd325e04410f036f2a791d66d8316c48c5387acdd914de99a5dd6afb3cd3.js:9:330

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ lpfulllib.js:1:20054

```

So I removed the Force https mode and that work again.  
So still have the main problem in Edit page. If you have another solutions …

---

<div class="post-metadata">

### Author: ![pokapow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pokapow/32/77900_2.png) [@pokapow](https://meta.discourse.org/u/pokapow)
#### Post date: [September 2, 2017, 5:41pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/18 "2017-09-02T17:41:52Z")

</div>

Nobody ever had this kind of problem ?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [September 18, 2017, 11:08pm UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/19 "2017-09-18T23:08:37Z")

</div>

A post was merged into an existing topic: [Problems setting up managed HTTPS on AWS](https://meta.discourse.org/t/problems-setting-up-managed-https-on-aws/70305)

---

<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: [October 6, 2019, 1:32am UTC](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146/20 "2019-10-06T01:32:03Z")

</div>



[Next page](https://meta.discourse.org/t/using-cloudflare-for-https-empty-preview-pane-in-edit-page/69146.md?page=2)
