Example of using docker-compose
to configure nginx (proxing an node.js app) behind varnish.
+---------+ +---------+ +---------+
----->| varnish |----->| ngix |----->| app |
+---------+ +---------+ +---------+
From the repo root, run:
docker-compose -p example up
To check the app running, run:
curl localhost:3000/some-path
To check the nginx proxing the app, run:
curl localhost:8080/some-path
To check the varnish on top of nginx, run:
curl localhost/some-path
All requets should return:
<!DOCTYPE html>
<html>
<head>
<title>App</title>
<link rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body>
<p><strong>Request received for:</strong> /some-path</p>
</body>
</html>