Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ALB responds with HTTP code 502 #688

Copy link
Copy link
@marovargovcik

Description

@marovargovcik
Issue body actions

Hey, I am attempting to deploy a small Express app to AWS as a Lambda connected to ALB via target group.

const serverless = require('@codegenie/serverless-express')
const express = require('express')

const app = express()

app.get('/200', function(req, res) {
	res.json({ message: 'all good' })
})

app.get('/404', function(req, res) {
	res.status(404).json({ message: 'not found' })
})

app.post('/test', function(req, res) {
	res.sendStatus(400)
})

module.exports.handler = serverless({ app })

I am able to successfully make a request to /200 and see the JSON response but I am not successful with requests that modify the status. In those I just see this response from ALB:

<html>

<head>
    <title>502 Bad Gateway</title>
</head>

<body>
    <center>
        <h1>502 Bad Gateway</h1>
    </center>
</body>

</html>

Can I please ask for guidance how would I go about debugging this? I don't see anything useful in my Cloudwatch logs of the Lambda function. Should I enable ALB logs?

Thank you.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.