Links in Parse Server emails are broken (validate account, reset password...)

Hello everyone :blush:

I try to install a Parse server on my local server (Ubuntu 20.04).

All features works fine… except one: the email system (for reset password or validate email address for example). I installed an adapter and the emails are sent, but the link they contain is broken: when I click on it I am redirected to an “Invalid link” page. After few hours of investigation, I don’t understand what happen.

Here are my configuration files:

  • First, I use Nginx as a proxy, here is the part of my config file for my domain name which concern my Parse server:

     location ~ ^/parse/(.*)$ {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-NginX-Proxy true;
                proxy_ssl_session_reuse off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
         location /parsedashboard {
                include proxy_params;
            location /login {
                include proxy_params;
            location /bundles {
                include proxy_params;
            location ~ ^/apps(.*)$ {
                include proxy_params;

  • Here is my Parse config.js file :

      "appName": "App name - Parse Server",
      "logsFolder": "/var/www/my/app/logs/",
      "databaseURI": "mongodb://localhost:27017/parsedb",
      "appId": "my_app_id",
      "masterKey": "my_master_key",
      "serverURL": "http://localhost:1337/parse",
      "publicServerURL": "",
      "port": 1337,
      "cloud": "/var/www/my/app/cloud/main.js",
      "push": {
          "android": {
                "apiKey": "my_api_key"
      "liveQuery": {
        "classNames":["Class_1", "Class_2", "Class_3"]
      "verifyUserEmails": true,
      "emailAdapter": {
        "module": "parse-server-mailgun-adapter-template",
        "options": {
          "fromAddress": "My app ",
          "domain": "",
          "apiKey": "my-api-key"

The links which are contained in e-mails seems good, for example:

But as I said, it redirects to an “Invalid link” page.

I tried to understand why this redirection happens by adding some log in parse-server/lib/Routers/PublicAPIRouter.js, in requestResetPassword(req) method and I saw that username and token got from query are empty:

     const {
          token: rawToken
        } = req.query;
        const token = rawToken && typeof rawToken !== 'string' ? rawToken.toString() : rawToken;
        if (!username || !token) {
      "  - usn : " + (!username) + ", token : " + (!token));
          return this.invalidLink(req);

I have the log: " - usn : true, token : true"

I’m not a expert in NodeJS (euphemism :sweat_smile:) so I don’t really know how to continue my investigations.

Do you have an idea of the cause of this problem?
(For information, all others features of my Parse server work fine: database access, cloud code, live query, dashboard…)

Thank you in advance :slight_smile:


The problem is probably related to your nginx setup (and not node :slight_smile: ). Please take a look at the thread below:

1 Like

Ok thank you very much !

I will look this thread :nerd_face:

It works !

Thank you @davimacedo , indeed the problem was in nginx configuration. I just added $is_args$args at the end of the “proxy_pass” line and all works :+1:t2:

The complete line is:

1 Like