Running docker pi docker on a RPI with apache already installed

Hi every one !
First of all thank you all for the great work you’re doing this. I’m so impressed about what we can do when were are all working together.

As far as I concern, I’m facing a ridiculously easy issue, but I think I can’t see the big picture…

I have a Raspberry pi 3+ running a RocketChat server (chat server, equivalent of Slack) on port 3000. I already installed Apache2 to redirect chat.domain.com to localhost:3000. I even succeed to create an SSL connection using LETS ENCRYPT and certbot

Now I would like to, on the same raspberry pi, install nextcloudpi (official docker version) and redirect cloud.domain.com to it.

So I ran the docker, bind containers port 80 and 443 to host ports 81 and 443 (-p 444:443 -p 81:80) because Apache2 already listen on 443 and 80. Then I also exposed port 443 and 80 of nextcloudpi docker (Just in case…). I can successfully acces nextcloud with host’s local ip address (https://192.168.0.17:444)

Next step was to create a virtualhost in my apache configuration (same as the chat one) and redirect cloud.domain.eu to localhost:444 (thanks to binded port) OR [container IP like 127.19.0.2] (thanks to exposed port). Both solution doesn’t work : I face an SSL_CONNECTION_ERROR or TOO_MANY_REDIRECTION_ERROR.

I must not be the only one facing an issue like that… Some other people must have many Docker web server and has to redirect to subdomain like I want.

So, What am I missing here, does anyone has a clue on what I have to do ? I can hear every thing, even removing Apache2 to another configuration…

Thank you all for reading this :slight_smile: