O'Reilly logo

The DevOps 2.0 Toolkit by Viktor Farcic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating the Service

We'll start by confirming that nginx does not know about the existence of our service:

curl http://prod/api/v1/books

After sending the request, nginx responded with the 404 Not Found message. Let's change this:

Exit
vagrant ssh prod
wget https://raw.githubusercontent.com/vfarcic\
/books-ms/master/nginx-includes.conf \
    -O /data/nginx/includes/books-ms.conf
wget https://raw.githubusercontent.com/vfarcic\
/books-ms/master/nginx-upstreams.ctmpl \
    -O /data/nginx/upstreams/books-ms.ctmpl
consul-template \
    -consul localhost:8500 \
    -template "/data/nginx/upstreams/books-ms.ctmpl:\
/data/nginx/upstreams/books-ms.conf:\
docker kill -s HUP nginx" \
    -once

We already did most of those steps in the previous chapter so we'll go through ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required