The APP_URL allows external apps to access the Shopware Cloud. To avoid errors, the following points should be observed:
Shopware must know under which domain the store can be reached by external services. You store the desired domain during the basic setup. This domain cannot be easily changed later in the administration. By default, the domain that is stored here is the domain of the first sales channel.
If your store already uses multiple domains in your sales channel, you should use one of them as APP_URL. External systems will then communicate with your store via this domain by default.
If you move your store to a new domain or if you have created your store within a staging environment with a different domain, you must not forget to adjust the configuration accordingly, otherwise there will be problems. Especially if the store is changed to https afterwards or if configuration files were copied and pasted.
The environment variable "APP_URL" must be configured so that it points to the domain under which the store can be reached from outside. An .env file in the root directory should start with the line "APP_URL={domain}" (e.g. APP_URL=https://my-shop.com) or can be adjusted accordingly in case of changes. Alternatively you can ask your hoster/agency to do this for you.
To prevent error messages (Wrongly configured APP_URL) because of the configuration of the domain, you can set the environment to dev (APP_ENV=dev). Error messages are only issued in production mode and should remind you to adjust the configuration.