Does your Vault cluster config have an api_addr set in its configuration?
If it does, that should be what’s being used as the scheme://host:port part of the URL – if not, Vault will try to determine one to use automatically, but it’s not always able to do this (I believe you can check by looking at the api_addr value in the output of vault read sys/config/state/sanitized). If none is set or auto-detected, you can specify the OIDC issuer explicitly as part of the OIDC provider setup.
root@vaultx:~# curl --header “X-Vault-Token: $VAULT_TOKEN” --request POST --data @payload.json $VAULT_ADDR/v1/identity/oidc/provider/my-provider/.well-known/openid-configuration -v
Note: Unnecessary use of -X or --request, POST is already inferred.
Trying 3.19.74.64:8200…
TCP_NODELAY set
Connected to vaultx.techrock.info (3.19.74.64) port 8200 (#0)
The OIDC well-known path isn’t an API endpoint you can send a configuration update to in Vault. Our Learn guide for setting up the OIDC provider will step you through how to set that up. But as a first step, what do you see for the api_addr when you run vault read sys/config/state/sanitized?
issuer(string: <optional>) - Specifies what will be used as the scheme://host:port component for the iss claim of ID tokens. This defaults to a URL with Vault’s api_addr as the scheme://host:port component and /v1/:namespace/identity/oidc/provider/:name as the path component. If provided explicitly, it must point to a Vault instance that is network reachable by clients for ID token validation.
You have set neither api_addr in the Vault configuration file, nor the issuer parameter when setting up the OIDC provider - you are going to have to set one of these.
I think you can just repeat step 5 of the “Create an OIDC provider” section in the Learn guide, but this time add issuer=https://[your Vault hostname]:8200 to the command parameters.
Then repeat step 6 as-is to check the OIDC well-known path to see if it worked.