I am having the same problem too with 502 error code, and i also tried changing it to localhost in advanced settings but it did not help at all. It seems Local poses more problems then solution it is rather easy to do it in old fashioned way here is my screenshot which outlines my directory structure, .env, site.conf
