0
votes

I am trying to configure a Chef Server under a VPC. The chef server is installed on an instance under public subnet and also given an Elastic VPC IP. chef-server-ctl reconfigure runs successfully but when i try to connect to the server from browser, i get "502 Bad Gateway"

Nginx log under chef server shows

2013/08/08 05:49:49 [error] 14051#0: *26 upstream prematurely closed connection while   reading response header from upstream, client: 1xx.72.xx.34, server: ec2-54-2x3-xx-184.us-west-2.compute.amazonaws.com, request: "GET /users/login HTTP/1.1", upstream: "http://127.0.0.1:9462/users/login", host: "54.2x3.xx.184"

How do i solve this problem. any help would be much appreciated.

2
Did you find a solution to this problem? It's okay to answer your own question. Please don't forget to mark an answer as correct! :) - sethvargo

2 Answers

0
votes

Check Your Security Group. Try stopping iptables on the server. Also check that all services are running fine on the server.

use - chef-server-ctl status for the same.

0
votes

I ran into this as well. You must use 127.0.0.1 for hostname resolution and not your VPC private IP.

sudo hostname "chef.local"
echo "chef.local" | sudo tee /etc/hostname
echo -e "127.0.0.1 `hostname` `hostname -s`" |sudo tee -a /etc/hosts

dpkg -i chef.deb