Continuing the discussion from Bad Gateway (nginx)
I have fixed this by running the following command in the terminal:
setsebool httpd_can_network_connect on -P
This is because the webserver is not allowed to make new network connections, so it can not proxy the request to Kibana.
Source: https://www.redpill-linpro.com/sysadvent/2016/12/15/elastic-stack-secure.html