etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Can't retrive admin panel behind Nginx reverse proxy under subdirectory (possible upstream experimental)

Open EL-File4138 opened this issue 1 month ago • 1 comments

Describe the bug Set up an instance behind Nginx reverse proxy under the subdirectory with methods from wiki. The main project works fine, but the admin panel failed to load. Upon further investigation, found that the assets are loaded relative to the webroot(<host>/admin/assets/...), but not to the subdirectory, which results in a failed rewrite catch for nginx. Checking for code, admin seems like a separate Vite project. Its build option base specified absolute one level to root, which would not work aforementioned. Other options are not available either, ./ would just result in resolving to webroot without admin level, ./admin is not supported. Seems like an experimental method described in Vite project document would work but with tweaking. Recommendation:

  • Make a fix to the path problem using the provided feature (experimental);
    • Should be the best to do, still using the current method to treat subdirectory build, but still experimental;
  • Provide a configuration to declare the use of subdirectory, rewriting the base path on the fly, for the admin panel only (Just adding a workaround instruction calling people to manually write would be helpful);
    • Quickest to do but not really recommended, more quirk to do between the main project and the admin panel;
  • Other possible fixes?

To Reproduce Steps to reproduce the behavior:

  1. Manual install and start the instance as described in README;
  2. Configure reverse proxy with the provided config in the wiki;
  3. Open the admin panel.

Expected behavior Admin panel should load.

Screenshots Incorrect loading when using subdirectory deployment

Server (please complete the following information):

  • Etherpad version: v2.0.3
  • OS: CentOS 9 Stream
  • Node.js version (node --version): v18.19.1
  • npm version (npm --version): 10.2.0
  • Is the server free of plugins: It's free of plugins.

Desktop (please complete the following information): Not relevant but here you go:

  • OS: Fedora
  • Browser [e.g. chrome, safari]: Mozilla Firefox
  • Version [e.g. 22]: 125.0.3

Smartphone (please complete the following information): Not relevant.

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

EL-File4138 avatar May 08 '24 12:05 EL-File4138