Binding Chef-server 12 to specific IP address: Connection refused connecting to https://127.0.0.1/users/, retry 1/5
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 303
- Forks
- 211
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
We have multiple applications running on the same server but on a different IPs (192.168.50.130:443 applicationA, 192.168.50.131:443 applicationB and so on)
We wanted to install chef server on the same machine. By default chef server's nginx listens on all IP address (0.0.0.0:443 and 0.0.0.0:80). As we had other application running on the same port 443, Chef couldn't bind its default ip address (0.0.0.0) to the port 443. So we changed the chef's nginx cookbooks to bind to a specific ip address. Now that we have chef server's nginx running on specific ip, 192.168.56.137:443. Just so you know we were also successfully able bring up chef.example.ca on a browser after changing it to a specific ip address.
The issue really is when we tried to create users using chef-server-ctl create-user command. We get the following error.
chef-server-ctl user-create user_name first_name last_name email password --filename FILE_NAME
Getting the error 5 times and message saying it gives up.
ERROR: Connection refused connecting to https://127.0.0.1/users/, retry 1/5
Here is my /etc/opscode/chef-server.rb
`
server_name = "chef.example.ca"
api_fqdn = server_name
notification_email = "NO-REPLY-CHEF@example.ca"
nginx configuration
nginx['url'] = "https://#{server_name}"
nginx['server_name'] = server_name
nginx['ssl_certificate'] = "/etc/nginx-certs/chef/chef.example.ca.crt"
nginx['ssl_certificate_key'] = "/etc/nginx-certs/chef/chef.acol.ca.key"
nginx['ssl_protocols'] = "TLSv1 TLSv1.1 TLSv1.2"
`
/etc/hosts file:
192.168.56.137 chef.example.ca
Could you please help me understand why chef is still looking to connect via localhost (127.0.0.1) while the configuration for server_name and api_fqdn is "chef.example.com". Also can this ip address be changed somewhere to 192.168.56.137? Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /etc/opscode/chef-server.rb and the nginx configuration described in the issue, then trace what chef-server-ctl create-user uses for its connection endpoint. Compare that endpoint with the configured server_name, api_fqdn, and /etc/hosts entry. Done means create-user completes successfully while Chef Server remains bound to 192.168.56.137.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nginx
- Domain
- infrastructure, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100