Having problems with angular on nginx with docker - swarm will not find service

I have written an app in angular that relies on a restful middle-ware layer which in turn contacts the business logic layer which manages the data on the database.

The infrastructure is as follows:

  • Mysql handles persistence
  • Business-logic on Tomcat 8.5.31
  • Restful-middle-ware on Tomcat 8.5.31
  • Front-end app on nginx 1.15.2 & angular 5

On my workstation everything works beautifully, however, after dockerizing all the services the front-end will not find the middle-ware services. below is my docker-compose.yml file:

version: "3.3"


    image: bilorge/seekr:ngxseekr-0.01
      - pub
      - 80:80

    image: bilorge/seekr:seekr-web-0.01
      - priv
      - pub

    image: bilorge/seekr:seekr-server-0.01
      - priv

    image: mysql:5.7
      - cker-db-data:/var/lib/mysql
      - MYSQL_ROOT_PASSWORD=&*$#$^##
        constraints: [node.role == manager]
      - priv

    driver: overlay
    driver: overlay


Its worth mentioning in order to make the application compatible to work docker and its services I added the service names to my hosts file on my work station. The entries were as follows:

  • ngxseeker
  • ckerws
  • seekr-service
  • ckerdb

this way when I run it locally on my workstation everything will resolve to the same service names inside the docker swarm. Again, all this works when I run it in my IDE or stand alone on my workstation.

Prior to running on swarm I comment the hosts entries to make sure they will not muddy the waters. when I deploy the stack (single node swarm) I wait and make sure all services are up and ready for work.

I then point my browser to and get my app’s landing page which greets me with login page. I provide the credentials and immediately fails. The developer tools indicate the post request goes out, but it never comes back.

I have verified the following:

  • Database has data
  • The business logic server is able to talk to the database
  • the middle ware server is able to resolve the business logic layer
  • the front end is able to resolve the middle-ware layer

On the last point I made a reverse proxy entry on ngix to hit the landing page for the Tomcat running the middle-ware layer and its successful. BTW, at boot up if nginx does not find the reverse proxy entries it will not start.

during a trouble shooting session I create a Ubuntu VM (latest) in Virtualbox with a bridged network as I wanted the vm get an ip from my router. I then deployed my stack, single node swarm, except for the front end which I was running from my work station. because the swarm was hosted externally I exposed port 8080 on the ckerws service. I also added a host entry for the vm and the service:

  • ckerws
  • poky

I fired up browser and pointed it to as usual the landing page loads up, however, this time when I provided the credentials it worked! if I bring in all the service under one swarm then it breaks…

I’m stumped and not sure whats going on… I have a feeling that it has to do we service scope resolution, however, I’m a bit out of my element there.

This issue has been resolved. The issue was related to a mis-configuration with NGINX. The reverse proxy rule was not setup correctly.