Hello,
I have a problem with my Nextcloud installation/configuration. I hope this is the right topic for it.
I was using Nextcloud on my Raspberry Pi 4 with Apache2 as webserver. These was running great i could upload new files, download files, show my photos etc.
Few days ago I decided to put the local installed Nextcloud instance in a docker container. I´ve googled and I found a manual on the official docker hub nextcloud page (Docker) at the bottom.
I did the steps and the Nextcloud instance was accessible from the local IP. But I want that I could use Nextcloud from outside of my home.
I decided to use traefik, which I use for a few more docker containers.
I have rewritten the docker-compose file from the Nextcloud to accessible it from outside. That works fine. I can access my nextcloud instance from outside over my domain.
So but I have a few problems now.
The first is when I want to show a photo in the Browser, Nextcloud says âError at loading Photo-xxx-xxx-xx.jpgâ.
Also an error occours when I use the Nextcloud Programm on my Windows PC.
Here are the log file from the Nextcloud Container, when i want to take a look at a photo:
Nextcloud Error Log
nextcloud_server_1 | 172.25.0.7 - - [27/Mar/2020:12:05:22 +0000] âPROPFIND /remote.php/dav/files/username/path-to-photo/Photo%xxxx%xxxx%205710.jpg HTTP/1.1â 207 1901 â-â âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36â
nextcloud_server_1 | 172.25.0.7 - - [27/Mar/2020:12:05:22 +0000] âPROPFIND /remote.php/dav/files/username/path-to-photo HTTP/1.1â 207 46554 â-â âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36â
nextcloud_server_1 | 172.25.0.7 - - [27/Mar/2020:12:05:22 +0000] âGET /core/preview?fileId=33388&x=1920&y=1080&a=true HTTP/1.1â 404 711 â-â âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36â
nextcloud_server_1 | 172.25.0.7 - - [27/Mar/2020:12:05:22 +0000] âGET /core/preview?fileId=33389&x=1920&y=1080&a=true HTTP/1.1â 404 711 â-â âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36â
nextcloud_server_1 | 172.25.0.7 - - [27/Mar/2020:12:05:22 +0000] âGET /remote.php/dav/files/username/path-to-photo/Video%xxxx%xxxx%%205543.mov HTTP/1.1â 503 11005 â-â âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36â
When i look at the error log it seems for me that Nextcloud want to GET a video instead of a photo. But i do not understand why. Are the fingerprints wrong?
Maybe I can fix it with this command?:
sudo -u www-data php occ maintenance:data-fingerprint
The other problem is after switching to docker image, I can not use the App Passwords. It says to me that https:// is required.
But when I access my Nextcloud instance I use https://. If i want to use the app i should switch to my old Nextcloud instance.
Below the error are several links to documentation sites. I tried these but it is still not accessible.
Here are the docker-compose.yml files and config.php files:
docker-compose.yml Traefik
version: â3.3â
services:
traefik:
image: âtraefik:v2.1.8â
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --api
- --certificatesresolvers.leresolver.acme.caserver=https://acme-v01.api.letsencrypt.org/directory
- --certificatesresolvers.leresolver.acme.email=e-mail address
- --certificatesresolvers.leresolver.acme.storage=/acme.json
- --certificatesresolvers.leresolver.acme.tlschallenge=true
- --log.level=DEBUG
ports:
- â80:80â
- â443:443â
volumes:
- â/var/run/docker.sock:/var/run/docker.sock:roâ
- â./letsencrypt/acme.json:/acme.jsonâ
labels:
# Dashboard
- âtraefik.http.routers.traefik.rule=Host(proxydomain
)â
- âtraefik.http.routers.traefik.service=api@internalâ
- âtraefik.http.routers.traefik.tls.certresolver=leresolverâ
- âtraefik.http.routers.traefik.entrypoints=websecureâ
- âtraefik.http.routers.traefik.middlewares=authtraefikâ
- âtraefik.http.middlewares.authtraefik.basicauth.users=admin:superstrongpasswordâ # user/password
# global redirect to https
- âtraefik.http.routers.http-catchall.rule=hostregexp({host:.+}
)â
- âtraefik.http.routers.http-catchall.entrypoints=webâ
- âtraefik.http.routers.http-catchall.middlewares=redirect-to-httpsâ
# middleware redirect
- âtraefik.http.middlewares.redirect-to-https.redirectscheme.scheme=httpsâ
networks:
- web
networks:
web:
external: true
docker-compose.yml Nextcloud
version: â3.3â
volumes:
nextcloud_data:
nextcloud_db:
services:
nextcloud_db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
labels:
- traefik.enable=false
volumes:
- nextcloud_db:/var/lib/mysql
- /backup:/backup
environment:
- MYSQL_ROOT_PASSWORD=reallyStrongPassword
- MYSQL_PASSWORD=anotherStrong Password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud_user
networks:
- internal
nextcloud_server:
image: nextcloud:17.0
labels:
- âtraefik.docker.network=webâ
- âtraefik.http.routers.nextcloud.rule=Host(domain1
,´domain2´)â
- âtraefik.http.routers.nextcloud.tls=trueâ
- âtraefik.http.routers.nextcloud.tls.certresolver=leresolverâ
- âtraefik.http.services.nextcloud.loadbalancer.server.port=80â
- âtraefik.http.routers.nextcloud.entrypoints=websecureâ
# Reverse-Proxy âTraefikâ Redirects fĂźr CalDAV / CardDAV:
- âtraefik.http.middlewares.calcarddav.redirectregex.permanent=trueâ
- âtraefik.http.middlewares.calcarddav.redirectregex.regex=https://(.*)/.well-known/(card|cal)davâ
-âtraefik.http.middlewares.calcarddav.redirectregex.replacement=https://$${1}/remote.php/dav/â
# - âtraefik.http.routers.nextcloud-sec.middlewares=calcarddavâ
links:
- nextcloud_db
depends_on:
- nextcloud_db
volumes:
- nextcloud_data:/var/www/html
restart: always
networks:
- web
- internal
networks:
web:
external: true
internal:
external: false
config.php Nexctloud docker
<?php
$CONFIG = array (
âinstanceidâ => âoclorr9hqnhsâ,
âpasswordsaltâ => âDQviA/YpyUbMCWI6XYa6H/j+Q8r4XGâ,
âsecretâ => â8I4OXX/wcLY6u4Y1tCmGKqJpL7F8EXogs1HIidoX0WS26sdWâ,
âtrusted_domainsâ =>
array (
0 => â192.168.1.12â,
1 => âdomain1â,
2 => âdomain2â,
),
âdatadirectoryâ => â/var/www/html/dataâ,
âdbtypeâ => âmysqlâ,
âversionâ => â17.0.4.2â,
âoverwrite.cli.urlâ => âhttp://192.168.1.12/nextcloudâ,
âdbnameâ => ânextcloudâ,
âdbhostâ => ânextcloud_db:3306â,
âdbportâ => ââ,
âdbtableprefixâ => âoc_â,
âmysql.utf8mb4â => true,
âdbuserâ => ânextcloud_userâ,
âdbpasswordâ => âanotherStrong Passwordâ,
âinstalledâ => true,
âmaintenanceâ => false,
âdata-fingerprintâ => â60092014328bb67396a838d464db71d0â,
âupdater.secretâ => â$2y$10$Ar.Fvb8jtE8Lp6FYPUPgWuAkiXD7ujcvjaZekMkD2F9lcIlEa3pFOâ,
âhtaccess.RewriteBaseâ => â/â,
âmemcache.localâ => â\OC\Memcache\APCuâ,
âapps_pathsâ =>
array (
0 =>
array (
âpathâ => â/var/www/html/appsâ,
âurlâ => â/appsâ,
âwritableâ => false,
),
1 =>
array (
âpathâ => â/var/www/html/custom_appsâ,
âurlâ => â/custom_appsâ,
âwritableâ => true,
),
),
âthemeâ => ââ,
âloglevelâ => 2,
);
config.php Nextcloud local
<?php
$CONFIG = array (
âinstanceidâ => âoclorr9hqnhsâ,
âpasswordsaltâ => âDQviA/YpyUbMCWI6XYa6H/j+Q8r4XGâ,
âsecretâ => â8I4OXX/wcLY6u4Y1tCmGKqJpL7F8EXogs1HIidoX0WS26sdWâ,
âtrusted_domainsâ =>
array (
0 => â192.168.1.12â,
1 => âdomain1â,
2 => âdomain2â,
),
âdatadirectoryâ => â/var/www/html/Nextcloud/dataâ,
âdbtypeâ => âmysqlâ,
âversionâ => â17.0.0.9â,
âoverwrite.cli.urlâ => âhttp://192.168.1.12/nextcloudâ,
âdbnameâ => ânextcloudâ,
âdbhostâ => âlocalhostâ,
âdbportâ => ââ,
âdbtableprefixâ => âoc_â,
âmysql.utf8mb4â => true,
âdbuserâ => ânextcloud_userâ,
âdbpasswordâ => âanotherStrong Passwordâ,
âinstalledâ => true,
âmaintenanceâ => false,
âdata-fingerprintâ => â4634e22ded6144e98e0b1d9a40330869â,
âupdater.secretâ => â$2y$10$Ar.Fvb8jtE8Lp6FYPUPgWuAkiXD7ujcvjaZekMkD2F9lcIlEa3pFOâ,
âthemeâ => ââ,
âloglevelâ => 2,
);
Thank you for your time to help me.
With best regards
Sebastian