Skip to content

[enhancement] Support for Configurable Base Path in WebAdmin InterfaceΒ #51

Open
@Sofahamster

Description

@Sofahamster

Hi,

I would like to propose an enhancement to add support for a configurable base path (or base URL) for the WebAdmin interface. This feature would make it easier to deploy the interface behind a reverse proxy, such as Nginx, when serving it on a subfolder (subpath) rather than the root URL.

For example:
If the WebAdmin interface is served at https://domain.tld/stalwartadmin/, the application should be able to handle the /stalwartadmin/ prefix in URLs seamlessly.

The nginx configuration would probably look like this:

location /stalwartadmin/ {
  proxy_pass https://localhost:8080/;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Proto $scheme;
}

Many modern web interfaces allow working behind reverse proxies on a sub-path, for example gitea allows setting the ROOT_URL, and the rspamd web interface even works on a sub-path without any configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions