How to set trusted proxy when using Nginx proxy manager

I’m trying to set up a nextcloud docker using nginx proxy manager.
Nextcloud itself works as expected but when I’m looking into the settings under Administration > Overview it says:

  • You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read the documentation page about this :arrow_upper_right:.

As far as I understand I have to add my proxy to trusted proxies either through a environment variable in my docker-compose file or directly in the config.php file. I tried to do that but it didn’t work.

  • Should I enter a IP or the name of the proxy container? (Apparently the IP changes)
  • If I can use the IP: How do I find out which IP I have to use?
  • If I should use the container name:
    • Does the environmental variable also support names or just IP address?
    • Can I use the container name even though the proxy manager is in a separate file?