Bad Gateway when accessing specific application preview page

workspace
nodejs

#1

I keep getting a 502 - Bad Gateway error when I access a particular route in my app. When I try to preview the app, my browser hangs for a long time before eventually displaying raw HTML for a 502 error page. I don’t see any errors in my console when this happens.


#2

Does it work if you use curl to access that page from localhost?

This error most often happens when the server doesn’t respond to the request, (e.g. in node that can happen if req.end is not called)


#3

It works, but it’s just redirecting me. The page with the problem requires (passport) authentication, and redirects to a login page without it. I’m just a novice and I am not sure how to use curl to access the page if it requires authentication.

EDIT
Okay, I think I managed it but I got an error. This is what CURL returned:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /questions/596e313d047cca0a8fdde74c/edit</pre>
</body>
</html>

#4

I don’t know why it is trying to POST… it shouldn’t be.


#5

Any updates or ideas on this? Anyone?

I’ve found a lot of forum posts reporting this or similar issues over time but I have never seen any solutions posted.


#6

i believe the error is in your code, most likely the server you are running doesn’t send response correctly.

But if you think it is caused by the proxy, please tell me the url of the page that is failing, and i will take a look.