500 server error: Failed to connect to Hub API at '<hostIP:8081>/hub/api'. Is the Hub accessible at this URL (from host: 610895540bb5)?

Hi, I’ve been having this error. When I go to the URL, it displays the version of Jupyterhub.

I have tried using this command “sudo ufw allow in on docker0 to any port 8081”
Also, here are my configs:
c.JupyterHub.spawner_class = ‘dockerspawner.DockerSpawner’

c.DockerSpawner.image = ‘jupyter/scipy-notebook’
c.DockerSpawner.hub_ip_connect = ‘’
c.JupyterHub.hub_ip = ‘’
#c.JupyterHub.hub_ip = ‘’
c.JupyterHub.port = 8000

I have also configured proxy in the docker http.conf file as well.