Allow Mailpit to run at a non-root app context such as /mailpit/
Is there a way to configure an application context? I need to serve Mailpit behind a proxy at https://{hostname}/mailpit/. However, the app artifacts (dist/app.js, etc) do not include that context.
This behavior would be similar to MailHog's MH_UI_WEB_PATH (docs)
The artefacts themselves should be relative to the entry point , so this should not be a problem and works fine here (at work we also use it as a virtual subdirectory which is proxies). Have you checked the http requests in your browser's debug tools to see what path it is using for those assets?
We currently also want to use Mailpit both behind a proxy, and directly.
Previously we used the option -ui-web-path, e.g. -ui-web-path mailpit to do this, but now this no longer works.
I don't understand how your proxy is set up. I use one that that is simply like this which works perfectly fine:
<Location "/mail/">
ProxyPass "http://localhost:8025/"
ProxyPassReverse "http://localhost:8025/"
</Location>
For us, we need to access the application at http://somehost:8025/mailpit/ (i.e. direct) and http://someproxy/mailpit/ so that does not work.
I have added a --webroot flag for you in v1.2.7
Thank you @axllent, and thanks to @macau23 for explaining our similar use cases. The changes are working well for me.