I have an error as yours, After that I found that my config of upstream is not included. Because I config upstream in a separated file. Please check Posted at Nginx Forum: http://forum.nginx.org/read.php?2,153847,234821#msg-234821