Nginx does not start: "host not found"

Solution 1:

The service runs nginx -t (test) before starting the server and this threw up an error:

host not found in upstream "localhost" in /etc/nginx/sites-enabled/default:27

That means you're making a reference to localhost, probably as part of a proxy_pass directive (just guessing) on line 27 of /etc/nginx/sites-enabled/default. And Nginx can't resolve it.

This might be cause for broader concern, but the most simple way around this is to just replace localhost with 127.0.0.1.