I have Strapi running running on a server on port 8000 and have a nginx that makes it available on https://strapi.mydomain.com.
When I click the “Forgot password” on the login page and am getting the password recovery email, the link inside is http://localhost:8000/admin/auth/reset-password?code=.... But I want the link to be https://strapi.mydomain.com/admin/auth/....
I tried setting STRAPI_URL=https://strapi.mydomain.com in the .env file but that didn’t help.
You need to give a value to “url” global variable, in your server.js file. the value should be an environment variable, and is generally composed by “HOST” and “PORT”, or another variable containing the whole url as you can see on the screenshot.
I am also looking for the same to use the same instance of Strapi installation to switch these details like reset password URL and email confirmation redirection URLs for different front-end applications like dev, staging and prod based on environment variables check.
Hey, looking for a solution to the very same problem. There is still no option to set the URL via environment variable so that the email templates catch it up with URL, correct?
I am running Strapi v5.12.3, this is my config/server.ts file: