Got 502 error when trying to bootstrip an instance

Got an error when adding a client on a new chef automate server on aws. We use aws chef automate service. [2018-01-31T19:03:24+00:00] ERROR: Server returned error 502 for, retrying 1/5 in 3s

[root@chefworkstation ca_certs]# knife bootstrap -N -x ec2-user -i /home/jyu/avery123.pem --sudo

Try to kill the process for nginx which are routing to different port and
then try.