Closed monaka closed 8 years ago
My app is like this. It is almost same as official example code.
var http = require('http');
var httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({
target: {
host: 'eclipse-che.default.svc.cluster.local',
port: 8080
}
});
var proxyServer = http.createServer(function (req, res) {
proxy.web(req, res);
});
proxyServer.on('upgrade', function(req, socket, head) {
proxy.ws(req, socket, head);
});
proxy.listen(process.env.PORT || 5000);
It seems deis scale web=2
is not effective in my case.
Is your SSO application built with a build pack? Are are you using another workflow like pushing a Dockerfile or a pre-built image?
At the first, I suspected this is a performance setting issue (like timeout). But it seems the root cause is CORS or something. I close this for now. And may re-open in case it requires to add something to nginx.conf.
I got it completely. The root causes are a bug in my script and Che's issue. Router is clean.
- proxy.listen(process.env.PORT || 5000);
+ proxyServer.listen(process.env.PORT || 5000);
I'm implementing SSO gateway for Eclipse/Che (cluoud IDE). It uses WebSockets. I implemented small proxy written in Node.js (named eclipse-che-gw) and deployed. And I'm facing 502 error on Router. Log is like this. Domains are fake.
My cluster is on Azure F2s x 4. All nodes are healthy. The result of
free
on the node which runs Router. Surely it's not rich but not too poor, I believe.I connect to the backend pod running Che directly and browsed. There looks fine.
It is sane nginx.conf generated by Rrouter.
502 error is reproduced only WebSocket connections. HTTP connections are fine. Are there any more check points and/or tuning points available?