Nextcloud + nginx proxy manager , sometimes works , most time not

Nextcloud version: 24.0.2 , docker version
Operating system and version (eg, Ubuntu 20.04): ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): apache 2.4.53
PHP version (eg, 7.4): 8.0.20

nginx proxy manager in docker version V2.9.16

Steps to replicate it:

  1. start a new nextcloud contrainer listen at 192.168.11.39:8084 with http protocol
  2. add a new host in nginx proxy manager

  1. open https://nextcloud.mydomain.com

sometimes it works , sometimes t does’nt

it could return a 502 bad gateway error , or invalid certificate files.

I could always connect to nextcloud with internal IP address , so the nextcloud container should have no problem at all.

I add the new host n nginx proxy manager by following document here

please , any suggestions ? or should I provide any other logs ?