mailpit icon indicating copy to clipboard operation
mailpit copied to clipboard

Allow Mailpit to run at a non-root app context such as /mailpit/

Open dforrest-es opened this issue 3 years ago • 3 comments

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)

dforrest-es avatar Oct 17 '22 18:10 dforrest-es

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?

axllent avatar Oct 17 '22 18:10 axllent

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.

macau23 avatar Oct 28 '22 09:10 macau23

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>

axllent avatar Oct 28 '22 18:10 axllent

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.

macau23 avatar Oct 31 '22 06:10 macau23

I have added a --webroot flag for you in v1.2.7

axllent avatar Oct 31 '22 09:10 axllent

Thank you @axllent, and thanks to @macau23 for explaining our similar use cases. The changes are working well for me.

dforrest-es avatar Nov 05 '22 23:11 dforrest-es