502 Gateway Error: Discourse Installation with SSL form Cloudflare

Just wanted to say that I fixed the 502 gateway error. I just needed to restart nginx using sudo service nginx restart