Describe the bug
When Etherpad is deployed behind a reverse proxy under a URL prefix, the pad toolbar home button ("Back to home") redirects to the domain root instead of the Etherpad home page under that prefix.
Example:
- Etherpad home is served at
/etherpad/
- A pad is opened at
/etherpad/p/testpad
- Clicking the home button redirects to
/
- Expected destination is
/etherpad/
This appears to be a client-side navigation bug in the home button implementation, not a reverse-proxy header configuration issue.
To Reproduce
Steps to reproduce the behavior:
- Deploy Etherpad behind a reverse proxy under a URL prefix such as
/etherpad
- Configure the proxy so Etherpad otherwise works correctly under that prefix (X-Proxy-Path: /etherpad)
- Open a pad, for example
/etherpad/p/testpad
- Click the toolbar home button ("Back to home")
- Observe that the browser is redirected to
/ instead of /etherpad/
Expected behavior
The home button should redirect to the Etherpad home page under the same public prefix, for example /etherpad/, not to the domain root.
Screenshots
If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
Desktop (please complete the following information):
- OS: linux, MacOS, windows
- Browser [e.g. Firefox, Chrome]; Firefox, safari and edge (respectively)
- Version [e.g. 128]
Smartphone (please complete the following information):
not tested on smartphone
** suspected bug
Client-side is not prefix-aware.
The current implementation in src/static/js/pad_editbar.ts is:
https://github.com/ether/etherpad/blob/develop/src/static/js/pad_editbar.ts#L485C1-L486C7
this.registerCommand('home', ()=> {
window.location.href = new URL('../..', window.location.href).href
})
On my instance:
in the js console:
window.location.href is set to "https://<mydomain>/etherpad/p/testpad"
so
new URL('../..', window.location.href).href is "https://<mydomain>/"
Describe the bug
When Etherpad is deployed behind a reverse proxy under a URL prefix, the pad toolbar home button ("Back to home") redirects to the domain root instead of the Etherpad home page under that prefix.
Example:
/etherpad//etherpad/p/testpad//etherpad/This appears to be a client-side navigation bug in the home button implementation, not a reverse-proxy header configuration issue.
To Reproduce
Steps to reproduce the behavior:
/etherpad/etherpad/p/testpad/instead of/etherpad/Expected behavior
The home button should redirect to the Etherpad home page under the same public prefix, for example
/etherpad/, not to the domain root.Screenshots
If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
node --version): version in https://hub.docker.com/layers/etherpad/etherpad/3.3.3/images/sha256-776e8d66b967c756771f681ae6f887f3ce3e831269728cddb0ab2537e23d1fa8Desktop (please complete the following information):
Smartphone (please complete the following information):
not tested on smartphone
** suspected bug
Client-side is not prefix-aware.
The current implementation in
src/static/js/pad_editbar.tsis:https://github.com/ether/etherpad/blob/develop/src/static/js/pad_editbar.ts#L485C1-L486C7