REST embedded JSON links do not resolve correctly, resolve to 'localhost'

I’m having a difficult time locating a configuration setting that can correctly set the embedded REST API links returned from calls. We run the Knime server behind an nginx proxy and in all other respects this seems to be happy, e.g. the Knime web portal works correctly, and calls to the KNIME REST API work correctly to https://our.knime.server/knime/rest/mumble.

Example call via the swagger interface…

curl -X GET "https://our.knime.server/knime/rest/v4" -H "accept: application/vnd.mason+json"

happily returns


{
  "@controls": {
    "self": {
      "href": "https://localhost:8443/knime/rest/v4",
      "method": "GET"
    },
    "knime:repository": {
      "href": "https://localhost:8443/knime/rest/v4/repository/{?deep}",
      "isHrefTemplate": true,
      "output": [
        "application/json"
      ],
      "title": "Workflow Repository",
      "method": "GET"
    },
    "knime:jobs": {
      "href": "https://localhost:8443/knime/rest/v4/jobs{?user}",
      "isHrefTemplate": true,
      "output": [
        "application/json"
      ],
      "title": "Workflow Jobs",
      "method": "GET"
    },
    "knime:node-recommendations": {
      "href": "https://localhost:8443/knime/rest/v4/node-recommendations",
      "output": [
        "application/json"
      ],
      "title": "Node Recommendations",
      "method": "GET"
    },
    "knime:admin": {
      "href": "https://localhost:8443/knime/rest/v4/admin",
      "title": "Administration",
      "method": "GET"
    },
    "knime:trash": {
      "href": "https://localhost:8443/knime/rest/v4/trash",
      "output": [
        "application/json"
      ],
      "title": "Recycle Bin",
      "method": "GET"
    },
    "knime:scheduled-jobs": {
      "href": "https://localhost:8443/knime/rest/v4/scheduled-jobs",
      "title": "Scheduled Jobs",
      "method": "GET"
    },
    "knime:profiles": {
      "href": "https://localhost:8443/knime/rest/v4/profiles",
      "title": "Client Profiles",
      "method": "GET"
    },
    "knime:logout": {
      "href": "https://localhost:8443/knime/rest/v4/auth/session",
      "title": "Invalidate session",
      "method": "DELETE"
    },
    "knime:session": {
      "href": "https://localhost:8443/knime/rest/v4/auth/session",
      "title": "Acquire a session cookie",
      "method": "GET"
    },
    "knime:access-token": {
      "href": "https://localhost:8443/knime/rest/v4/auth/jwt{?validUntil}",
      "isHrefTemplate": true,
      "title": "Acquire a JWT token",
      "method": "GET"
    },
    "knime:property-info": {
      "href": "https://localhost:8443/knime/rest/v4/properties",
      "output": [
        "application/json"
      ],
      "title": "Repository Item Properties",
      "method": "GET"
    },
    "knime:license-server": {
      "href": "https://localhost:8443/knime/rest/v4/licenses",
      "title": "License Server",
      "method": "GET"
    }
  },
  "@namespaces": {
    "knime": {
      "name": "http://www.knime.com/server/rels#"
    }
  }
}


It’s this ‘localhost:8443’ in the links that is the issue, if I copy that url and substitute the proper host name it’s all happy.

I did mine the various configs and even attempted in /apps/workflow_repo/config/client-profiles/default


# Add a mount point for this server


#/instance/org.knime.workbench.explorer.view/mountpointNode/KNIME-Server/restPath=https://our.knime.server/knime/rest

But that only caused errors across the entire API…how do I get the REST api to return proper links?

Hello,

Per the KNIME Server Administration documentation [1]:
{
com.knime.server.canonical-address=<URL to server> [RT]

The communication between executor and server is performed through the server’s REST interface. In case auto-detection of the server’s address doesn’t work correctly, you have to specify the canonical address here, e.g. http://knime-server:8080/. This option is not required if server and executor are running on the same computer. See also section enabling workflow execution below for more details.

Env: KNIME_SERVER_CANONICAL_ADDRESS=<URL to server>

([RT] = changes can take effect at runtime)
}

Please test specifying this value and see if it resolves the issue for you.

Thank you,
Nickolaus

[1] https://docs.knime.com/2019-12/server_admin_guide/index.html