Email validation account link wrong base url

Hi i’m using the strapi provider sendgrid for the email. But when an email with a link (to validate an account) was sent, it is a wrong BASE URL : http://localhost:28687/auth/email-confirmation?confirmation=myCode. I set the url in the strapi BO but it doesn’t works in production, i don’t understand what is this : “http://localhost:28687/

Thanks in advance

One of the following (depending if you are using NODE_ENV)

  • ./config/server.js
  • ./config/env/yourNodeEnv/server.js

You need to set the url key to the public domain including the http/https and rebuild your admin panel.

Hi @DMehaffy your are talking about the url property and i see in the description :
Public url of the server. Required for many different features (ex: reset password, third login providers etc.). Also enables proxy support such as Apache or Nginx, example: The url can be relative, if so, it is used withhttp://${host}:${port} as the base url. An absolute url is however **recommended** .

The example in the description talking about api url ? example:
In my case i’ll have two urls :

  • One for my BO and my api like : https// && https//

  • One for the public website : https//

And of course i would like, when a link is send by mail, redirect to an url of my public website when an account is validate for example : https//
Should I set the property url with absolute path of my public website ?
no problem doing that?


I tried to do this and i have now a CORS to access to the admin bo strapi policy issue :

Capture d’écran 2020-11-24 à 13.22.48

Remove the trailing slash on the url but yes if you have your api routes and admin split you need to use the

You will have an issue in routing through trying to mount the admin panel on the root of your strapi domain. We have an open bug report about that here:

See the following guide for Nginx which does also include the server.js settings: and

@DMehaffy it is not a split between api routes and admin. Admin BO and api routes are on the same domain. I have another domain for my frontend public application and an user can create an account with this application. I would like the link in the email to have the public site url inside and not localhost or strapi BO url

In that case you will need a custom option on your frontend that can parse that parameter and forward it to your Strapi backend application using the

You can customize the email template to provide that frontend url but it will require you to build that page.

Hi @DMehaffy i tried your solution and it works now.
I overridden the sendEmailConfirmation method in plugin/users-permissions/services and i changed sur URL sent with my frontend url application (environnement variable) + the token to update an user.
After i create the specific page where I do the GET request auth/confirmation-email with the token passed in params tu validate the account.
For overridde methods in my backend strapi I had to do another route for the email confirmation and copy past the code of the original in the new method. I can’t directly override the existing route auth/email-confirmation.
I don’t know if it is normal, btw it works.
Thanks for your help

Glad you got it working!

hi @Jean1 how did you manage to modify the template of the reset password email ?
I did it in parametres>email templates but I still receive te default one. Any ideas ?

Thanks in advance for your help

Hi @jeremy did you set the url here ?

Yes i did, I display the good url, but the template in parametres>email templates doesn’t show up in my email from sendgrid or AWS SES @Jean1