CSS/HTML Customisation editor not working behind proxy


(Thomas Abraham) #1

I’m running the Discourse container (1.7.8) behind an Apache which is running behind the Akamai CDN.
I don’t get the css/html customisation editor working
SSL is terminated at Apache.
Discourse is running in a subfolder.

Is there anybody out there having the same issue or setup? Any hint highly is appreciated.

this.element.style is undefined
this.setVisible@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:257750
u@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:257532
a@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:257847
g@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:276350
t.edit@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:342779
n.default<.value/</<@https://www.mydomain.com/forum/assets/admin-5338f058fb4ffa0fb15692c8b7f7062daffbdd7858293e9811ff5c6abac818b6.js:2:20430
n@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:939
s/a@https://www.mydomain.com/forum/javascripts/ace/ace.js:1:1492
n.default<.value/<@https://www.mydomain.com/forum/assets/admin-5338f058fb4ffa0fb15692c8b7f7062daffbdd7858293e9811ff5c6abac818b6.js:2:20334
S@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:19:24942
O@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:19:25028
T/<@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:19:25531
a.prototype.invoke@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:3:26531
a.prototype.flush@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:3:27069
u.prototype.flush@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:3:27837
p.prototype.end@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:3:28182
p.prototype.run@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:3:29309
l@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:9:423
l</e.prototype.handler@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:6:2801
e.default<.setupHandler/<@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:12:19960
oe.event.dispatch@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:2:16724
oe.event.add/g.handle@https://www.mydomain.com/forum/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:2:14832
ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:7:28905

(Joshua Rosenfeld) #2

Does everything else work as far as you can tell? When does this error appear? Are you able to open the editor at all? I don’t have a Discourse instance running 1.7.8 anymore, but I did a 1.7 install in a subfolder behind a NGINX proxy without issues.


(Thomas Abraham) #3

It seems that everything else is working, except minor issues with the mini-profiler and, probably still, a missing prefix for /assets/ (Subfolder and cascading proxies: javascript ressource is loaded from /assets/ instead of /subfolder/assets/). The latter I’ve worked around on our global proxies.

The editor is not shown at all. It is just a blank area, regardless which defined stylesheet I choose.

this.element.style is undefined
this.setVisible ....

This issue has not come up recently. It was already there when I found the asset prefix bug above. But resolving this does not seem to resolve the editor issue.

To be honest, I was setting up that instance more than a year ago, it is still not public due to missing internal priorities and ressources in our company. But what I’ve been seeing so far is that the customisation editor is the only blocking issue.

My apache proxy setup is simple - probably I miss something.

<VirtualHost *:443>
    ...
    <Location />
        AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html text/javascript application/javascript text/plain text/xml text/css
        Substitute "s#http:/#https:/#i"
        Substitute 's#"/mini-profiler-resources/#"/forum/mini-profiler-resources/#'
        Substitute 's#"/images/#"/forum/images/#'
    </Location>
    ...
    RequestHeader set x-forwarded-for %{XFF_CLIENT_IP}e
    RemoteIPHeader XFF_CLIENT_IP
    ...
    <Location /forum>
        Header  edit*   Location        http://www.mydomain.com      https://www.mydomain.com
        Header  edit*   destination_url http://www.mydomain.com      https://www.mydomain.com
    </Location>
    ...
    ProxyPreserveHost   On
    ...
    ProxyPass           /forum/ http://127.0.0.1:8080/forum/
    ProxyPassReverse    /forum/ http://127.0.0.1:8080/forum/
</VirtualHost>

(Thomas Abraham) #4

Does anybody care of this issue?

It is still reproducable with two installations of Discourse. Everything else seems to work properly, but the editor isn’t working unless you bypass the proxy. The latter isn’t an option since we are having an SSO interface defined requiring the proxied connection.


(Joshua Rosenfeld) #5

@thabbs, the issue here isn’t that no one cares, it’s simply that you have a very specific setup, with a very specific issue. I had a similar (but not identical) setup and could not reproduce this at that time. With such a unique issue, and no one being able to reproduce it, it is challenging to assist. I no longer have access to that setup, and most likely no one else has a setup like yours.