Can't get Lemmy-UI to make API requests against Lemmy backend
Hello, I'm setting up Lemmy + Lemmy-UI + pict-rs on my k8s cluster. I've gotten all the components deployed, and I'm able to access the Lemmy and Lemmy-UI instances via local tunneling. However, I'm having trouble using Lemmy-UI to sign in or administer my instance.
I can successfully POST to /api/v3/user/login against the Lemmy API directly, but this same request fails when made in my browser through Lemmy-UI. Instead of rendering JSON, I receive an HTML "not found" page.
I also see this category of failure on other pages. For example, visiting http://localhost:lemmy-ui-port/communities in my browser makes a request to GET http://localhost:lemmy-ui-port/api/v3/community/list?type_=Local&sort=TopMonth&limit=50&page=1, which returns the Lemmy-UI 404 page rendered as HTML (The page you are looking for does not exist).
It seems like Lemmy-UI is failing to handle requests to /api endpoints properly and is not forwarding them along to the backend.
I've verified that Lemmy-UI can access Lemmy by shelling into the Lemmy-UI container and running these commands successfully:
lemmy-ui doesn't proxy things to the backend for you, that's why the official Ansible/docker-compose use NGINX to direct any POST requests and Content-Type: application/activity+json as well as blanket sends some paths directly to the backend. See nginx_internal.conf