We cover a small gotcha that could waste your time.
tl;dr
If your code (e.g. php/php-fpm) is executed on a separate container as your web server (e.g. nginx), then pinging localhost
as an HTTP request wont' work, because there's no web server listening for HTTP requests within your code (php) container!
Use the hostname of your Nginx/web server container instead, e.g. http://nginx
instead of http://localhost
.