Local acces to nextclound in docker behind reverse proxy

Hello,
I hope this post is in the right group. If not, please move it to the right place.

I’m trying to setup nextclound using docker on a pi4 with ngix as reverse proxy and webserver and with Letsencryt. The access from outside via the domain (nextcloud.mydomain.net) works well.

But I can’t access the webserver in my local network so that I can sync my PC without using the external domain.

The pi4 is behind my FritzBox and has the IP 192.168.178.20. Unfortunatly I can’t acces the website with https://192.168.178.20/index.php/login.
I always get a empty page with the error

503 Service Temporarily Unavailable

Here is my current docker compose file: https://pastebin.com/AsLdipfK

What do I need to get access also from my local network?

define a virtual host in - ./proxy/vhost.d:/etc/nginx/vhost.d for 192.168.178.20

you could also configure your internal dns to point nextcloud.mydomain.net to 192.168.178.20

in ./proxy/vhost.d I found only a default file with following content:

location ^~ /.well-known/acme-challenge/ {
auth_basic off;
auth_request off;
allow all;
root /usr/share/nginx/html;
try_files $uri =404;
break;
}

did you check the documentation of the proxy container https://hub.docker.com/r/jwilder/nginx-proxy ?

this

    environment:
      - VIRTUAL_HOST=nextcloud.mydomain.net

makes your proxy listen to nextcloud.mydomain.net and route traffic to the according container.

this

might help. but you could/will run into problems with the certificate. i guess.

so you have to create the locap-ip.conf yourself and make it in side the container available.

sorry that i can’t provide the correct syntax.

p.s.: i think that was discussed in forum already. grafik