I'm making a JQuery Ajax call from React frontend to an Express backend. Frontend is served by nginx on port 80, backend is listening on port 3000. The call from react to express looks like this
$.ajax({
url: "http://localhost:3000/events?lat="+latitude+"&lng="+longitude+"&distance=15000&sort=time&until=%2B1%20week",
dataType: "json",
cache: false,
success: function(data) {
this.replaceState({data: data.events});
}.bind(this),
error: function(xhr, status, err) {
console.error(this.props.url, status, err.toString());
}.bind(this)
});
When I try to do this on Windows 10 host, it works seamlessly, but when I deploy the containers to Digitalocean's docker image (Docker 1.12.2 on Ubuntu 14.04) the nginx server is not able to reach Express server: ERR_CONN_REFUSED
Curl localhost:80 and curl localhost:3000 from host are working fine. I'm able to ping between the containers,from inside the container's shell
sudo docker exec -i -t [container_id] /bin/bash
I tried to disable the firewall, but it's already disabled by default on this image.
sudo ufw disable
Any hints what to try next? I'm out of ideas.