Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a relative/local WebContext Path argument #25

Closed
oers opened this issue Jan 8, 2015 · 8 comments
Closed

Provide a relative/local WebContext Path argument #25

oers opened this issue Jan 8, 2015 · 8 comments

Comments

@oers
Copy link
Contributor

oers commented Jan 8, 2015

I tried to use Mailhog together with an apache-proxy.

ProxyPass /mailhog http://localhost:8025/
ProxyPassReverse /mailhog http://localhost:8025/

Mailhog tries to resolve all resource absolute to the host:

http://localhost/images/hog.png

image

I think mailhog needs an optional webcontext argument like -webcontext mailhog, which will then search all resources under /mailhog/.. instead of /

@ian-kent
Copy link
Member

ian-kent commented Jan 8, 2015

Just made all URLs relative in the web UI (for API calls and static content), means you can have a single MailHog instance proxied from different endpoints if you need to (or, continue to use the real MailHog UI as well as the proxied one).

I used nginx to test it which gave me some issues with the event stream - switched off proxy buffering and it worked. Thought I'd mention it in case you get the same with Apache.

@oers
Copy link
Contributor Author

oers commented Nov 16, 2015

Sorry for giving feedback too late, but this doesn't seem to work,

Refused to load the script 'http://10.100.160.27/js/jquery-1.11.0.min.js' because it violates the following Content Security Policy directive: "script-src 'none'".

For http://10.100.160.27/mailhog

and

    ProxyPass /mailhog http://localhost:8025/
    ProxyPassReverse /mailhog http://localhost:8025/

@graemetait
Copy link

Just a +1 to say that I'm also trying to proxy through Apache, and have the same issue as oers with the latest version of MailHog.

@oers
Copy link
Contributor Author

oers commented Dec 8, 2015

@ian-kent could you please reopen this issue? Or should I create a new one?

@ian-kent ian-kent reopened this Dec 8, 2015
@paolomainardi
Copy link

I confirm the problem, any solution out there ?

@oers
Copy link
Contributor Author

oers commented Mar 1, 2016

I am trying to build a solution for this in https://github.com/oers/MailHog-UI.
But it is not working as expected at the moment. I hope to create a fix for this, when I find the time :)

oers added a commit to oers/MailHog-Server that referenced this issue Mar 6, 2016
@ian-kent
Copy link
Member

Closing this as I think it's been fixed by @oers contributions

@ghost
Copy link

ghost commented Dec 1, 2020

I'm trying to proxy from sibling docker container:

version: '3'
services:
  web:
  ...
  mail:
    image: mailhog/mailhog
    environment:
      MH_UI_WEB_PATH: mail

with service "web" providing proxy:

<VirtualHost *:80>
	ProxyPreserveHost On
	ProxyPass /mail http://mail:8025/
	ProxyPassReverse /mail http://mail:8025/
</VirtualHost>

but all I get on http://web/mail is:
grafik

I am happy about every hint...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants