Using ".js" in the page title breaks nginx #2166

Closed
opened 2026-02-05 03:10:22 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @Salvora on GitHub (Mar 19, 2021).

Describe the bug
if you create a new page with a title ending with .js, this breaks the nginx and renders the page inaccessible with "404 Not Found" errors just for this page.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to a book
  2. Create a blank page
  3. title it with something like "Node.js" (without quotes)
  4. See error

Expected behavior
Should behave normally and open the page as normal.

Screenshots
If applicable, add screenshots to help explain your problem.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.31.7
  • PHP Version:
  • Hosting Method (Nginx/Apache/Docker): docker

Additional context
It is pretty serious because you are stuck with this page. You cannot access it so you cannot delete, rename or move it.

Originally created by @Salvora on GitHub (Mar 19, 2021). **Describe the bug** if you create a new page with a title ending with .js, this breaks the nginx and renders the page inaccessible with "404 Not Found" errors just for this page. **Steps To Reproduce** Steps to reproduce the behavior: 1. Go to a book 2. Create a blank page 3. title it with something like "Node.js" (without quotes) 4. See error **Expected behavior** Should behave normally and open the page as normal. **Screenshots** If applicable, add screenshots to help explain your problem. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.31.7 - PHP Version: - Hosting Method (Nginx/Apache/Docker): docker **Additional context** It is pretty serious because you are stuck with this page. You cannot access it so you cannot delete, rename or move it.
OVERLORD added the 🐕 Support label 2026-02-05 03:10:22 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

Hi @Salvora,

Pages saved with such a title should not contain a . in the url path for the page. The example provided should save with a URL path ending with /page/nodejs. Is that the same behaviour with your instance? If not, can you provide the path you get redirect to after save?

My guess for this would be overly general rules written in the webserver config, with a rule looking for URLs ending with js instead of .js. It'll be wroth checking the webserver rules active on both the proxy in front of your container (If existing) and the webserver within the container.

@ssddanbrown commented on GitHub (Mar 19, 2021): Hi @Salvora, Pages saved with such a title should not contain a `.` in the url path for the page. The example provided should save with a URL path ending with `/page/nodejs`. Is that the same behaviour with your instance? If not, can you provide the path you get redirect to after save? My guess for this would be overly general rules written in the webserver config, with a rule looking for URLs ending with `js` instead of `.js`. It'll be wroth checking the webserver rules active on both the proxy in front of your container (If existing) and the webserver within the container.
Author
Owner

@Salvora commented on GitHub (Mar 19, 2021):

Yes, page url doesn't contain .
the page titled "koko.js" in book titled "dummy" url:
....books/dummy/page/kokojs
but this url throws error anyway.
image
I use Home Assistant addon for BookStack so webserver is not in my control. I was thinking maybe the way the url arranged is wrong for this case.
If the problem is not the internal webserver, I can open a bug report on the addon page.

@Salvora commented on GitHub (Mar 19, 2021): Yes, page url doesn't contain `.` the page titled "koko.js" in book titled "dummy" url: `....books/dummy/page/kokojs ` but this url throws error anyway. ![image](https://user-images.githubusercontent.com/6360098/111776273-da27b380-88c2-11eb-8ace-2925adcd626f.png) I use Home Assistant addon for BookStack so webserver is not in my control. I was thinking maybe the way the url arranged is wrong for this case. If the problem is not the internal webserver, I can open a bug report on the addon page.
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

Thanks for confirming.

The URL example you've provided looks fine and as per expected, I would not want to add additional edge-case handling within the app itself to handle misconfigured web servers at all.

If this is definitely not something within your control then yeah, I'd also recommend raising with the BookStack hassio-addons project: https://github.com/hassio-addons/addon-bookstack. They're generally active. From a quick look I could not see anything in there that would cause this but I don't have a home assistant setup to test on.

@ssddanbrown commented on GitHub (Mar 19, 2021): Thanks for confirming. The URL example you've provided looks fine and as per expected, I would not want to add additional edge-case handling within the app itself to handle misconfigured web servers at all. If this is definitely not something within your control then yeah, I'd also recommend raising with the BookStack hassio-addons project: https://github.com/hassio-addons/addon-bookstack. They're generally active. From a quick look I could not see anything in there that would cause this but I don't have a home assistant setup to test on.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2166