# Ember CLI is upsetting nginx

**URL:** <https://meta.discourse.org/t/ember-cli-is-upsetting-nginx/242585>\
**Category:** Self-hosting\
**Tags:** unsupported-install, docker\
**Created:** [October 21, 2022, 11:22am UTC](https://meta.discourse.org/t/ember-cli-is-upsetting-nginx/242585 "2022-10-21T11:22:37Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [October 21, 2022, 11:22am UTC](https://meta.discourse.org/t/ember-cli-is-upsetting-nginx/242585/1 "2022-10-21T11:22:37Z")

</div>

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](https://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.4.4), 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:

```plaintext
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](https://meta.discourse.org/t/142537?silent=true)? (because the chain of communication should be very similar).

The Discourse version is 2.8.9

Header in the dock (minor snips for brevity):

```plaintext
< 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**

```

---

_[View the full topic](https://meta.discourse.org/t/ember-cli-is-upsetting-nginx/242585)._
