nginx: permission denied
Robin-Sch opened this issue · comments
Error in /var/log/onlyoffice/documentserver/nginx.error.log
:
open() "/var/lib/onlyoffice/documentserver/App_Data/cache/files/data/conv_check_839219840_docx/output.docx" failed (13: Permission denied), client: 172.25.0.7, server: , request: "GET /cache/files/data/conv_check_839219840_docx/output.docx/check_839219840.docx?md5=EV8RL2LHRS_VFH-kalbWOw&expires=1683034051&filename=check_839219840.docx HTTP/1.1", host: "onlyoffice.mydomain.com"
I already tried changing the ownership of the file to www-data
(so nginx should have the correct permission/access):
chown www-data:www-data /var/lib/onlyoffice/documentserver/App_Data/cache/files/data/conv_check_839219840_docx/output.docx
ls -al /var/lib/onlyoffice/documentserver/App_Data/cache/files/data/conv_check_839219840_docx/output.docx
# -rw-r--r--+ 1 www-data www-data
Then going to
https://onlyoffice.mydomain.com/cache/files/data/conv_check_839219840_docx/output.docx/check_839219840.docx?md5=EV8RL2LHRS_VFH-kalbWOw&expires=1683034051&filename=check_839219840.docx
gives still the same error
And also restarting nginx
pkill nginx
nginx &
gives the same error.
docker-compose:
nextcloud-onlyoffice:
container_name: nextcloud-onlyoffice
image: onlyoffice/documentserver:latest
restart: always
volumes:
- ./onlyoffice:/var/www/onlyoffice/Data
Traefik forwards onlyoffice.mydomain.com
to nextcloud-onlyoffice:80
Nextcloud config:
trusted_domains = nextcloud.mydomain.com, office.mydomain.com
ONLYOFFICE Docs address: https://onlyoffice.mydomain.com/
Secret key: xxxxx (grabbed from running the command below, needs to be updated every time the container is recreated)
docker exec nextcloud-onlyoffice /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'
Hello @Robin-Sch i checked our manual and current repository https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud#installation, i dont have any errors. As I can see, your docker-compose part is not like our file in this repo and owner /var/lib/onlyoffice/documentserver/App_Data/cache/files/data/
must be user named ds
in our docker installations.
My compose file is slightly modified from https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud/blob/master/docker-compose.yml. I shrank down onlyoffice-document-server
, removed the ports (because of traefik), removed the logs volume.
With or without the environment variable with both cases it gives the same error.