Server url not setting properly on production

default discord avatar
Rick
7 months ago
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
    Payload Team
    7 months ago

    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
    Rick
    7 months ago

    Yup, that fixes it. Thanks!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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