Possible to set 'Custom server access URLs' via env var or similar?

I deploy plex media server via kubernetes, which occasionally means the pod gets restarted for one reason or another.

When plex gets restarted it always loses the value I set for ‘Network->Custom server access URLs’. I always have to browse in and set this value back because without it my mobile is unable to find my server (which I access via a vpn).

Is there some way to specify this value via an environment variable or something similar in order to set it automatically so its good to go even if I need to restart it on occasion?

If there’s no simple way to set it, could you point me to where the value lives on the server and I can see about remoting in there and setting the value myself (if I have to).

You could try setting the “ADVERTISE_IP” environment variable in your configuration. The Plex official images (at least) honor this variable and will set the custom server access URLs field based upon its value.

There’s a bit of documentation about it here:
https://hub.docker.com/r/plexinc/pms-docker