I am trying to make Valet and Local work together on Mac but with no luck. There's probably a DNS conflict with dnsmasq.
For example I have these two sites, with the default configuration setup:
Site on Local:
local-site.local
Local is an environment optimized for setting up WordPress sites locally. I am using all the default settings. Local can be downloaded here: https://localwp.com/
Site on Valet:
valet-site.test
There's nothing special in the Valet configuration either:
/Users/goran/.config/valet/config.json
{
"tld": "test",
"paths": [
"/Users/goran/.config/valet/Sites",
"/Users/goran/projects"
]
}
/Users/goran/.config/valet/dnsmasq.d/tld-test.conf
address=/.test/127.0.0.1
listen-address=127.0.0.1
Note: Both sites have different suffixes, so suffixes shouldn't be an issue.
Scenario #1
Start both Valet and Local
Results:
- Valet site works fine
- Local site shows "502 Bad Gateway" error from nginx.
When I open Local it shows this error:
"There is a port conflict with this site's domain."
This is probably returned from Valet, it probably has DNS priority over Local.
Scenario #2
Start only Local
Results:
- Local site works fine
- Valet site shows an error (as expected since Valet is not started). It's interesting that this error comes from Local:
404 Site Not Found The site you requested does not have an associated route in Local. If you continue to get this message after refreshing, try restarting the Local site.
It looks like something is wrong with DNS setup, but I'm not sure what exactly.