Redirect from ip to "hostname.domain.com"

Hello. Has anyone encountered the problem of redirecting an https request from ip to “gitlab.example.com” with a deployed DNS server? Share your knowledge, please.

This link might be useful sense gitlab uses the nginx web server.

I am also having this problem, but I haven’t had a chance to try it yet.