Facebook error parsing input URL error 502 Bad Gateway

I did plenty of research on trying to fix the issue, but I'm still having no luck with it.

When I share my page I get 502 Bad Gateway on Facebook. I played around with the www.conf file because others had posted that it works for them, but no luck for me.

I also restarted PHP-FPM and I still am getting the same results.

connect() failed (111: Connection refused)