you likely missing all/some config.php settings related to hosting Nextcloud behind reverse proxy. Please review reverse proxy configuration likely it works if you add overwrite* parameters to your config.php
it’s always bad idea to access the system with different URLs/local IP. I recommend you to use “split-brain DNS” or “split-horizon DNS” so you can access local resources using public DNS name and https/TLS. Following this advice simplifies configuration and troubleshooting as you don’t need to maintain different configs for local and remote access: