Bower install fails with 502 - Bad Gateway when downloading bower packages.
For example bower install for ember library gives following response in command line.
Simplest solution is to just upgrade bower to latest version
If installed via NPM:
npm i -g bower