Using Cloudflare for HTTPS, empty preview pane in edit page


#1

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:

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 ?


(Jay Pfaffman) #2

See How to use Discourse Safe Mode


#3

Same thing in safe mode, with 3 options disabled…


(cpradio) #4

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


#5

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:

#6

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:

(cpradio) #7

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)?


#8

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.


(cpradio) #9

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.

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


#10

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 ?


(cpradio) #11

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)


#12

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.


#13

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 …

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 …


#14

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 ? ^^


(cpradio) #15

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

SSH into box, run

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

#16

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


#17

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

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 …


#18

Nobody ever had this kind of problem ?


Problems setting up managed HTTPS on AWS
(Kane York) #19

A post was merged into an existing topic: Problems setting up managed HTTPS on AWS