upstream sent too big header while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxxxxx.com, request: "GET /index.php?skin=protean&mix=3 HTTP/1.1"
For the mentioned error in your log, this is the first fix.
I observed that if user is logged out of site the changing of templates works, however if user logs in, switching of templates don't work. They still receive 502 gateway error, any idea?