Error 502: When accessing web server

Command used: curl

response: curl: (7) Failed to connect to port 8006 after 0 ms: Couldn't connect to server

I also have another server that I will need to get working. It is Pi-Hole and it is an http server giving me the same 502. But don’t worry about it right now because I can get it working later.

Also running curl (Which is my pi-hole server) gives me the webpage that pi-hole displays, but still gives me 502 Error.