[Bug]: PDF Ebook fails to load in web-browser behind reverse proxy at /audiobookshelf #3267

Open
opened 2026-04-25 00:14:39 +02:00 by adam · 3 comments
Owner

Originally created by @kareemalgalaly on GitHub (Mar 19, 2026).

What happened?

Trying to read an ebook using the web-interface does not work. Looking at the network a request is made to

/api/items/83dd64e7-2ca0-4e44-8e14-80edbe7c84ee/ebook

but in the use-case of a reverse proxy serving audiobookshelf on /audiobookshelf, this path fails.

What did you expect to happen?

I expected the ebook to appear in the reader. Instead I only get a blank page.

Image

Steps to reproduce the issue

  1. Reverse proxy audiobookshelf at /audiobookshelf. e.g. for nginx
location /audiobookshelf {                                                                                                                
    proxy_pass http://127.0.0.1:80;                                                                                                     
}
  1. Add a pdf ebook to the library
  2. Go to 127.0.0.1/audiobookshelf/library
  3. Click on the book and click on read

Audiobookshelf version

v2.33.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox

Logs


Additional Notes

The browser view works if I do not go through the reverse proxy. It is only with being served behind a reverse proxy at /audiobookshelf

Originally created by @kareemalgalaly on GitHub (Mar 19, 2026). ### What happened? Trying to read an ebook using the web-interface does not work. Looking at the network a request is made to ``` /api/items/83dd64e7-2ca0-4e44-8e14-80edbe7c84ee/ebook ``` but in the use-case of a reverse proxy serving audiobookshelf on /audiobookshelf, this path fails. ### What did you expect to happen? I expected the ebook to appear in the reader. Instead I only get a blank page. <img width="1052" height="932" alt="Image" src="https://github.com/user-attachments/assets/998522c4-256f-4e51-a9c4-a8c25b9ff06a" /> ### Steps to reproduce the issue 1. Reverse proxy audiobookshelf at /audiobookshelf. e.g. for nginx ``` location /audiobookshelf { proxy_pass http://127.0.0.1:80; } ``` 2. Add a pdf ebook to the library 3. Go to 127.0.0.1/audiobookshelf/library 4. Click on the book and click on read ### Audiobookshelf version v2.33.0 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Firefox ### Logs ```shell ``` ### Additional Notes The browser view works if I do not go through the reverse proxy. It is only with being served behind a reverse proxy at /audiobookshelf
adam added the bug label 2026-04-25 00:14:39 +02:00
Author
Owner

@kareemalgalaly commented on GitHub (Mar 19, 2026):

I believe the issue is around line 107 in audiobookshelf/client/components/readers/PdfReader.vue

@kareemalgalaly commented on GitHub (Mar 19, 2026): I believe the issue is around line 107 in audiobookshelf/client/components/readers/PdfReader.vue
Author
Owner

@kareemalgalaly commented on GitHub (Mar 19, 2026):

I have fixed this in a fork and tested the browser client works for PDF.

https://github.com/kareemalgalaly/audiobookshelf/commit/a926df3aaee4d7a8e572d9344c35437bdd6f4aad

@kareemalgalaly commented on GitHub (Mar 19, 2026): I have fixed this in a fork and tested the browser client works for PDF. https://github.com/kareemalgalaly/audiobookshelf/commit/a926df3aaee4d7a8e572d9344c35437bdd6f4aad
Author
Owner

@kareemalgalaly commented on GitHub (Mar 19, 2026):

This appears identical to https://github.com/advplyr/audiobookshelf/issues/3865 which had been fixed before.

    return `${this.$config.routerBasePath}/api/items/${this.libraryItemId}/ebook/${this.fileId}`

It is unclear when and/or why the fix was removed. Or at least it was only fixed for epubs.

@kareemalgalaly commented on GitHub (Mar 19, 2026): This appears identical to https://github.com/advplyr/audiobookshelf/issues/3865 which had been fixed before. return `${this.$config.routerBasePath}/api/items/${this.libraryItemId}/ebook/${this.fileId}` It is unclear when and/or why the fix was removed. Or at least it was only fixed for epubs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3267