- Ensure that you have a working Docker installation
- Create the folder
conf.d
on your working path - Download and copy the
default.conf
from this gist into theconf.d
folder - Run the docker command
docker run -p 80:80 -v <working-path>/conf.d:/etc/nginx/conf.d --name nginx-logging openresty/openresty:alpine
Make sure you replace the <working-path>
with the full path of the directory that contains the conf.d
folder.
All requests will be responded with a 200 OK
status code and some ummy JSON and will be logged including the request headers and body.
The logs can be viewed by accessing the URL: http://localhost/_logs