Auth endpoints returning 404 behind Cloudflare Tunnel
Hi there! I've just made my first Better Auth website using SvelteKit. I'm trying to now set it up on my domain through a Cloudflare Tunnel to my home server. I've followed the SvelteKit guide for setting up Better Auth and it worked while developing when the auth URL in the .env file was set to my local IP. However, when I set up the Cloudflare Tunnel, set the better auth url to my website's public URL, then try to interact with any of the auth endpoints, I just get 404s. I can see in the server console:
and in the browser console:
I'm not sure where to go from here - I've tried setting the better auth URL to the server's internal IP, but then it just tries to call the auth endpoints from that local IP which won't work externally. Has anyone else experienced this and could have a possible fix? Thank you! š
0 Replies