How to setup chef-server 11 with cookbook (DNS problem, nginx proxy)?

After install server in local network, I has this config

server {
listen 80;
server_name chef.example.lab;
access_log /var/log/chef-server/nginx/rewrite-port-80.log;
rewrite ^(.*) https://$server_name:443$1 permanent;
}

As you can see there is a rewrite rule.

This server installed on machine in local network (out local domain
example.lab)

I want to setup our gateway nginx proxy frontend with backend to this
internal chef server.

I already setuped ssl certificates and nginx fronend with servername
chef.example.com, our internet domain.

I want to proxy chef.example.com to chef.example.lab, but when I open in
browser url

http://chef.example.com, it’s redirected me to http://chef.example.lab

Why this occurs?

So I want that my intranet clients and internet clients connect to chef
server with “independent” internet url: chef.example.com

For intranet clients I’ve setup fake dns zone with one name
chef.example.comand chef server internal ip address.

I already runs several sites so.

But by default chef-server setup rewrite.

Why it’s setup rewrite rule by default ?

Are this a true use case ?

Thank you very much.


Faithfully yours,

CVision Lab System Administrator
Vladmir Skubriev