I make a simple server send event with nodejs. It run perfectly on localhost. When I upload it to my VPS. The request to subscribe link is pending
. I cant get any message from backend. Same issues on Chrome and Safari, no console error . In Chrome this request like image :
Asked
Active
Viewed 545 times
0

trquoccuong
- 2,857
- 2
- 20
- 26
-
This is a CORs issue. Your server needs to responds with the proper Access-Control headers. – idbehold Apr 15 '16 at 18:28
1 Answers
2
I found this problem. It a nginx problems. Add some config to nginx
location / {
proxy_pass http://127.0.0.1:3000;
proxy_buffering off;
proxy_cache off;
proxy_redirect off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

trquoccuong
- 2,857
- 2
- 20
- 26