So I’m pursuing an unsupported docker install.
This means running Ember CLI in its own container with a shared volume on a different port and proxying, as expected, to Rails server.
Unfortunately, for all
.css assets, I’m getting “Bad Gateway 502” from curl and from browser when going fully via https and the nginx reverse proxy.
It appears that Ember CLI is adding a
Content-Length Header despite having
transfer-encoding: chunked already added by the Rails server
(I can check the response from Rails and Ember by addressing different ports)
This doesn’t officially break the HTTP 1.1 protocol standard, I believe (it’s supposed to be ignored) :
“If a message is received with both a Transfer-Encoding header field and a Content-Length header field, the latter must be ignored.”
… but it does cause nginx to balk and announce a 502 and not serve the asset, so this is moot.
I can browse a css file with curl directly to the container on localhost, but at nginx level, it is NOT happy:
upstream sent "Content-Length" and "Transfer-Encoding" headers at the same time while reading response header from upstream
Anyone have any ideas of how to stop Ember CLI doing this or a workaround? I’m surprised this is not an issue with the standard install? (because the chain of communication should be very similar).
The Discourse version is 2.8.9
Header in the dock (minor snips for brevity):
< content-transfer-encoding: binary < content-type: text/css; charset=utf-8 < referrer-policy: strict-origin-when-cross-origin < set-cookie: __profilin=p%3Dt; path=/forum; HttpOnly; SameSite=Lax < **transfer-encoding: chunked** < Vary: Accept, Accept-Encoding < x-content-type-options: nosniff < x-discourse-route: stylesheets/show < x-download-options: noopen < x-frame-options: SAMEORIGIN < x-permitted-cross-domain-policies: none < x-xss-protection: 0 < content-encoding: null < **Content-Length: 3055**