NuxtN
Nuxt9mo ago
8 replies
JakeT

Multi Line Runtime Config from Env

I am trying to load a certificate from runtime config.
It works fine locally (windows), but when i deploy it (dockerized) the runtime config value is set to empty string.

export default defineNuxtConfig({
  ...
  runtimeConfig: {
    pg: {
      ssl: {
        ca: ''
      }
    }
  }
  ...
})


NUXT_PG_SSL_CA="-----BEGIN CERTIFICATE-----
...
...
...
-----END CERTIFICATE-----"


console.log({ config: useRuntimeConfig().pg })

local:
{ pg: { ssl: { ca: '-----BEGIN CERTIFICATE-----...' }}}


production:
{ pg: { ssl: { ca: '' }}}
Was this page helpful?