Fixing NGINX Logging when running from NPM in Docker

Sept 1, 2018 Last updated Sept 1, 2018

I share a fix for NGINX not logging when run from NPM script inside docker, and why Google might not be the best anymore

Here's a short one. I wasn't finding much help for this from Google.

When running NGINX from an NPM script inside a docker container (which I assure you I'm only doing in development), NGINX logging is broken. I kept getting the following error:

2018/09/01 04:55:52 [emerg] 76#76: open() "/var/log/nginx/access.log" failed (6: No such device or address)

The solution was just to add tty: true to the docker-compose file, and the problem was solved.

Google was no help. I think Google tries to use too much machine learning so now many search results are now useless. It will straight ignore words in my query or give more weight to certain sources (e.g. Github) even though its not the best result. The engine simply tries to be too smart.

After a week of this bug, and seeing a Hacker News comment about this same problem with Google, I tried Duck Duck Go again with a simple nginx docker No such device or address and the solution was the second result.

Duck Duck Go F**k Yourself