I installed the server hosting the angular2 -webpack-starter project for the nodejs front-end and backj site. By default, nginx has two proxy_pass for mapping connections to the right places on the server. ALMOST everything works as expected. BUT there is a problem with the proxy server sockjs-node/infothat really surprised me.
At startup, I see:
zone.js:1960 GET https://localhost:3000/sockjs-node/info?t=1490740454197 net::ERR_CONNECTION_CLOSED
Two proxies:
location ^~ /server/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass https://127.0.0.1:9000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ^~ / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
I looked at server-side other answers to this problem, but to no avail. I tried adding cors material to the front-end, which does not make sense, and this has no effect. I tried disabling proxy_buffering to no avail (as expected). I even added 'underscored_in_headers on;' in nginx, to no avail.
webpack-dev- -, , nginx , webpack-dev-, .
, .