I can open pdf file successfully on the website by local ip address like 192.168.1.xxx but I failed to open pdf when I use my domain to access the nextcloud. It’s very stange.
PS:My server has no public ip address so I use frp to access it.
Above is what I get when I open by domain.
Most likely the PDF file is corrupt. To be sure, download the file from Nextcloud via the download icon (upper-right area in your screenshot), then open the downloaded PDF in a local PDF viewer, such as Adobe.
If it also fails to open, then you know, the problem isn’t with your Nextcloud but with the PDF file itself.
Downloading and opening in Adobe work well. I try to install docker version and proxy it to public ip and I get ‘Message: Unexpected server response (0) while retrieving PDF “https://xxx.xxx.xxx/remote.php/webdav/Nextcloud%20Manual.pdf”.’
Regarding the webdav URL, I guess you mean something like
otherwise the webdav URL is not correct like this, because username is missing in the path and it should just be “dav” instead of “webdav”.
I held the same opinion at first. However, I have tried that I can succeed in downloading pdf from “https://hostname/remote.php/webdav/Nextcloud%20Manual.pdf”. I wonder if it has business with I use nginx to do proxy? Does PDF.js have probelm to process files in different servers(docker(nextcloud apache2) and host(nginx))?
By the way, “https://192.168.1.101:port/remote.php/webdav/Nextcloud%20Manual.pdf” works well.