flask-lambda icon indicating copy to clipboard operation
flask-lambda copied to clipboard

support for Application ELB target

Open rejithcr opened this issue 5 years ago • 2 comments

While calling from application ELB, always getting 502 gateway error

rejithcr avatar Jul 07 '20 17:07 rejithcr

Same here with a VPC endpoint for API gateway. The error internally appears to be because headers flask-lambda is expecting are not set by the upstream:

[ERROR] KeyError: 'HTTP_X_FORWARDED_PORT'
Traceback (most recent call last):
  File "/opt/package/flask_lambda.py", line 102, in __call__
    make_environ(event),
  File "/opt/package/flask_lambda.py", line 58, in make_environ
    environ['HOST'] = '%(HTTP_HOST)s:%(HTTP_X_FORWARDED_PORT)s' % environ

sidoh avatar Sep 21 '20 19:09 sidoh

Yes, @sidoh , having the same issue when deploying the lambda within a VPC.

kubitz avatar Dec 06 '21 14:12 kubitz