Also a problem here was that nginx failed to bind to port 80 as expected. For example no sign of these ‘healthy’ diagnostics in the logs:
frappe@erpnext:~/frappe-bench$ sudo netstat -tlnp | grep 80
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 1639/python
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1946/nginx
frappe@erpnext:~/frappe-bench$ less /var/log/nginx/error.log | grep bind
2017/09/30 05:33:14 [debug] 2392#0: bind() 0.0.0.0:80 #6
The problem was this link was missing:
frappe@erpnext:~/frappe-bench$ ls -al /etc/nginx/conf.d/
total 8
drwxr-xr-x 2 root root 4096 Sep 30 05:32 .
drwxr-xr-x 5 root root 4096 Sep 30 05:39 …
lrwxrwxrwx 1 root root 43 Sep 30 05:32 frappe-bench.conf → /home/frappe/frappe-bench/config/nginx.conf
To restore this symbolic link, do this:
frappe@erpnext:~/frappe-bench$ sudo ln -s /home/frappe/frappe-bench/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf
restart nginx to load the change:
frappe@erpnext:~/frappe-bench$ sudo service nginx restart
- Restarting nginx nginx [ OK ]
btw to enable and view debug output in /var/log/nginx/error.log
to this /etc/nginx/nginx.conf add this line:
error_log /var/log/nginx/error.log debug;