mediacms icon indicating copy to clipboard operation
mediacms copied to clipboard

Discovered a missing config that prevents successful AWS ALB fronting

Open alfred-stokespace opened this issue 2 years ago • 2 comments

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

  • OS: Ubuntu 20.04
  • Installation method: single server, with customization
  • ALB w/Azure oAuth2 SSO

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

buffer-size=65535

alfred-stokespace avatar Dec 31 '22 16:12 alfred-stokespace

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

alfred-stokespace avatar Dec 31 '22 16:12 alfred-stokespace

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

mgogoulos avatar Jan 19 '23 12:01 mgogoulos