-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
I've an nginx reverse proxy setup identical to the one described in the wiki. I'm hosting etherpad on a subdirectory url (/test) and giving this info to the etherpad server via the X-Proxy-Path header.
When I'm running my etherpad instance in prod mode , everything works as expected. However, when I switch to dev mode, the etherpad server is adding absolute links to a script that don't take into account the X-Proxy-Path header; this brings HTTP 404 for that content and results in incomplete rendering.
<script src="/watch/index?hash=RcpJttf4cN8"></script>
You can see this error if you navigate to the root page or to any pad.
This error seems to be in specialpages.ts where it seems there's no call to add a prefix with the value of the X-Proxy-Path header if present, as it's done in
other files such as in admin.ts.
To Reproduce
Steps to reproduce the behavior:
- Install an nginx reverse proxy setup with etherpad hosted on a subdirectory (e.g. /pad).
- Run etherpad on dev mode
pnpm run dev
- Browse the main page or go to any pad. The link I described above wil be absolute and the rendering of the page will be incomplete as the script will return a 404.
Expected behavior
In a reverse proxy setup with etherpad hosted on a subdirectory, all the generated links should be either relative to themselves or to the value given in the X-Proxy-Path header.
Server (please complete the following information):
- Etherpad version: 2.5.0
- OS: debian 12.12
- Node.js version (
node --version
): v22.19.0 - npm version (
npm --version
): 10.9.3 - Is the server free of plugins: yes
Desktop (please complete the following information):
- OS: [e.g. iOS] debian 12.12
- Browser [e.g. chrome, safari] firefox
- Version [e.g. 22] 143.0
Additional context
Etherpad installed from scratch directly from github, for testing v.2.5.0.