-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Access to MailPit (was MailHog) redirects to novarnish.[hostname] #21
Comments
No, it should be working correctly without changing port. The HTTP*EXPOSE there is exposing mailhog; it's not being "used" by varnish. I'm not saying that you haven't found a bug. |
I'm fairly new to docker / ddev - have been working with Varnish on production / dev servers with NGINX as a proxy up until now and trying to make our dev environment portable. I have not seen this set-up before, so not too certain exactly what is used by what, apologies. I do have a custom varnish VCL but it's not doing any redirecting. |
I confirm that it redirects (and succeeds) with @skeemer could you please take a look at this? I imagine it has to do with |
http://[hostname]:8025 is supposed to redirect to http://novarnish.[hostname]:8025 and does when I just tested it. It has to do that because configuring varnish to also route MailHog got really complicated. From what I remember, varnish isn't really built to handle routing multiple ports in parallel. |
OK, so can be worked around by binding MailHog to a different port? Or, as MailHog is bound to port 8025 in a default install perhaps Varnish should be using a different port in this particular context? In my particular case (and I realise I may be in the minority here) I always need Varnish on as it does Edge Side Includes - I have stuff built into my VCL that allows me to bypass Varnish for various things. So if there is a way to sacrifice the http://novarnish.[hostname]:8025 functionality for access to MailHog, that would be a fine fix for me. |
You can edit any file added by the That being said, unless you configure varnish to pass 8025 from the varnish service to the web service, you won't be able to reach MailHog because the web instance is made available on the novarnish subdomain. You can see this in the file |
In services:
web:
environment:
- VIRTUAL_HOST=novarnish.[hostname],novarnish.[second hostname] I have 2 hostnames with 2 separate NGINX So essentially, if I delete the services:
varnish:
ports:
- "8025:8025"
expose:
- "8025" Would solve:
Does that look right? |
That would do that, but then I'm not sure that anything would actually pass through varnish because web might remain primary for 80. |
You are right - this doesn't work. I have found a work-around though: In Many thanks for your help. |
Note that you can just add the hostname novarnish. to your /etc/hosts and this works fine. Not sure that was clear. |
There is another way to solve this. You can remove the ".ddev/docker-compose.varnish-extras.yaml" file and then change the virtual host in .ddev/docker-compose.varnish.yaml to :
Now everything will work, and if you need varnish, just put varnish. in front of your local domain. |
I was going to reply with the following, but that I realized you can just consider the varnish.* as the primary. Sometimes hard to think past the ideal.
|
Hi, I have a the PR #25 that should help fix it. No change needed for me in |
As I'm sure you know it's not mailhog any more, but mailpit, please update references to that as well? Nothing functional should be affected. |
In the MR, there is no reference to Mailhog, either in the description, or in the commit message, or in the change. Which references do you think about? This issue title? |
Well at least issue title 😅 |
Ok, I can't edit it. I think only maintainers of the repository and the issue author can edit the title :) |
I opened the issue - title updated and the issue text. |
Oh sorry, I thought it was your new issue! Using my phone on a bike tour in Chile. |
No problem, enjoy your travel :) |
MailHogMailPit should be available on theweb
service on port8025
but attempting to visit: http://[hostname]:8025 from the host system redirects to http://novarnish.[hostname]/.This seems to be something to do with these lines in
docker-compose.varnish.yaml
which appear to be using the same port asMailHogMailPit should be on:Or even here:
I'm guessing a workaround might be to have
MailHogMailPit on a different port?The text was updated successfully, but these errors were encountered: