I want to run a Nextcloud instance on my personal computer that uses a dynamic DNS (DDNS) to be exposed to the world. Nextcloud is running on Docker:
version: '3.5'
services:
nextcloud:
image: nextcloud:latest
depends_on:
- database
volumes:
# ...
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
env_file:
- ./nextcloud.env
environment:
VIRTUAL_HOST: "ddnsdomain.test.org:50001"
LETSENCRYPT_HOST: "ddnsdomain.test.org:50001"
LETSENCRYPT_EMAIL: "nextcloud@ddnsdomain.test.org"
NETWORK: proxy
restart: unless-stopped
database:
image: mariadb:latest
env_file:
- ./nextcloud.env
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: unless-stopped
networks:
default:
external:
name: proxy
and I thought to use NGINX Proxy Automation to place a NGINX proxy server upon my local machine to get HTTPS automatic redirection.
Now, after running NGINX Proxy Automation (running on a Docker network named proxy) and Nextcloud I should be able access my computer from the outside world, so I should just access ddnsdomain.test.org, the problem is that I don't want to expose port 80 and 443 of my personal computer, so I tried to bind 443 to a custom port via Port Forwarding on my router, so I got 443 -> 50001 via router.
Now I expect to see the Nextcloud instance when accessing https://ddnsdomain.test.org:50001, but unfortunately I just get: 503 Service Temporarily Unavailable and if I access http://ddnsdomain.test.org:50001 I get:
400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx/1.20.1
What am I doing wrong?
Do I maybe need to use VIRTUAL_PORT (see Ports) as container env variable?
Is it really possible what I'm trying to accomplish?
Thanks