Server url not setting properly on production

default discord avatar
Ricklast year
4

I have trouble getting the server url right on production. I have set the

serverUrl

property to

process.env.SERVER_URL || http://localhost:4000

. That env variable is also set inside the docker container to the production url. But when I open it is stuck on the first user screen having the popup loading in the middle.

  • discord user avatar
    jmikrut
    last year

    use the variable name

    process.env.PAYLOAD_PUBLIC_SERVER_URL


    because if you don't prefix your env var with

    PAYLOAD_PUBLIC_

    , it won't be accessible in your admin panel



    if you

    do

    prefix it like that, we will automatically expose it for you

  • default discord avatar
    Ricklast year

    Yup, that fixes it. Thanks!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.