Like what we’re doing? Star us on GitHub!

Server url not setting properly on production

Rick
3 weeks 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.

image.png
Screenshot_2023-02-23_at_22.50.41.png
Screenshot_2023-02-23_at_22.50.59.png
  • jmikrut
    Payload Team
    3 weeks 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

  • Rick
    3 weeks ago

    Yup, that fixes it. Thanks!

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More