Just moving a Backdrop Site from local to a NGINX server that we maintain. The sites seems to work from on the front end, but when I try to login, I get a 502 Bad Gateway error?

I don't remember seeing this before. What do I try next?

Accepted answer

Solved my problem. It was pretty fringe, so I'm not sure if this will help anyone else. BUT, when I went back to my local DDEV version of the site, I was getting some weird errors in similar circumstances. 

Error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in BackdropLocalStreamWrapper->mkdir() (line 780 of /var/www/html/core/includes/stream_wrappers.inc).

The StreamWrapper in question was involved in making directories. I checked my system.core.json config file and realized that shortly before copying site to remote server, I had tried changing the private path from "private" to "private://". 

This was the problem. This was an incorrect path and was causing the infinite loop on local site and the Bad Gateway error on server. Once I changed the path (edited the config file), back to "private", everything worked again both locally and on server.

Comments

Solved my problem. It was pretty fringe, so I'm not sure if this will help anyone else. BUT, when I went back to my local DDEV version of the site, I was getting some weird errors in similar circumstances. 

Error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in BackdropLocalStreamWrapper->mkdir() (line 780 of /var/www/html/core/includes/stream_wrappers.inc).

The StreamWrapper in question was involved in making directories. I checked my system.core.json config file and realized that shortly before copying site to remote server, I had tried changing the private path from "private" to "private://". 

This was the problem. This was an incorrect path and was causing the infinite loop on local site and the Bad Gateway error on server. Once I changed the path (edited the config file), back to "private", everything worked again both locally and on server.