Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 28058

Azure Node.js application returns HTTP error 502 even if it works on other platforms

$
0
0

Hi to all,

(I have been redirected here from this forum http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/7bcef13e-0c6a-4985-bc2a-9ae4bed689c9)

I have a strange situation with our Node.js proxy application, it works fine on a standalone server and Heroku (passes the integration tests) but we get a strange HTTP 502 error from Azure.

When we deployed on Azure, normal HTTP GET requests works just fine but not the POST methods. The POST messages are forwarded to other servers. In reality the app half works because it forwards the POST data correctly but Azure's IIS fails on the returned response.

The error that I get is this:

Headers

< Content-Type: text/html
< Server: Microsoft-IIS/7.5
< Set-Cookie: ARRAffinity=<a long random number>;Path=/;Domain=our-app-name.azurewebsites.net
< X-Powered-By: ASP.NET
< Date: Tue, 12 Feb 2013 21:31:56 GMT
< Content-Length: 1477

Body (I skip the html and css stuff)

502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

We are 100% sure that our app works because I tested it on a unix machine and on Heroku. Also I didn't see any errors from the app in the logs LogFiles/nodejs/. The problem is how IIS processes the response of the app (that it is just a JSON).

I immagine that we need to configure web.config but could not find anything relative.

The application uses Express.js and https://github.com/nodejitsu/node-http-proxy

Thank you


Viewing all articles
Browse latest Browse all 28058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>