Accessing Kibana using hostname

I have an ELK setup on Ubuntu and I am trying to access the Kibana Web through hostname. I can access Kibana with my IP address but not hostname despite setting the server.publicBaseUrl: "https://:5601".

I am enable to curl the hostname however the HTTP status code returned is HTTP/ 1.1 302 Found, Location: /spaces/enter. What is the problem?