mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.75k stars 505 forks source link

Discovered a missing config that prevents successful AWS ALB fronting #686

Open alfred-stokespace opened 1 year ago

alfred-stokespace commented 1 year ago

Describe the issue

502 bad gateway if you have an AWS ALB w/Azure Oauth2 SSO fronting your mediacms instance.

To Reproduce Steps to reproduce the issue:

  1. comment out the lets encrypt stuff from install.sh, we are going to use the ALB's ssl abilities
  2. create a non-localhost instance (use the dns you purchased)
  3. edit the nginx available site to have the host header matching the dns name
  4. point the ALB at nginx port 80
  5. you will see this error. [error] 45757#45757: *341 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.100.3.146, server: yoursite.domain.com, request: "GET / HTTP/1.1", upstream: "uwsgi://127.0.0.1:9000", host: "yoursite.domain.com"

Expected behavior Functional AWS ALB SSL fronting port 80 mediacms site.

Screenshots N/A

Environment (please complete the following information):

FIX add the buffer size increase below to... /home/mediacms.io/mediacms/deploy/local_install/uwsgi.ini

buffer-size=65535
alfred-stokespace commented 1 year ago

took much searching to discover the fix. The magic was in this post... https://stackoverflow.com/questions/22697584/nginx-uwsgi-104-connection-reset-by-peer-while-reading-response-header-from-u

mgogoulos commented 1 year ago

Wondering whether this worths to be set as the default value...