502 bad gateway supermarket

My Chef server (12.0.7) on rhel 6.8 and my supermarket server (2.8.30-1.el6.x86_64) on rhel 6.7 webpages work normally separately.

I have configured both to work together following private supermarket install steps on docs.chef.io. But when I click ‘Sign in’ on the supermarket site, I get the following error:

502 Bad Gateway
ngx_openresty/1.4.3.6

Any ideas how to fix this?

I tried solution on this page https://github.com/chef/supermarket/issues/1098 but the error remains the same.