In this post, I’m sharing the nginx config needed to set up a reverse proxy for enabling custom domains in Auth0.
I’ll start by explaining why I needed this, but if you don’t care about that, you can just skip straight to the code.
I’ve mentioned before that I use Auth0 for authentication and authorization in Machine Learning for Kids. (And I’ve mentioned before that the developer experience using Auth0 is generally fantastic).
But I’ve had one auth-related complaint from schools since launching the site. And it’s been increasing in the last couple of months:
Users who have their web browsers set to block third-party cookies weren’t able to log in.
This is because the cookies were coming from an auth0.com domain, and not machinelearningforkids.co.uk.