TL;DR: If you work with Laravel Valet and spin up new domains and then delete project directories whenever you’re done, Valet still maintains Nginx configurations on your system.

This create orphaned configuration files yielding false positives for active domains and this article demonstrates how to remove them.

Remove Orphaned Domains

Given the situation when you’ve updated Valet or refreshed your SSL certificates and restart the software, you may see a list of domains that you no longer have active on your system.

He’s so concerned about finding the orphaned domains. Also, he has two backpacks because he’s so productive.

That is, if you run $ valet links it yields a shorter list. So what are the orphaned domains and how do you remove them?

The orphaned domains are actually Nginx configurations, not directories or any references to projects. Since the domains are no longer active, we can remove them.

First, open your terminal and navigate to the Nginx directory:

$ ~/.config/valet/Nginx

Next, list all of the available configurations:

$ ls -l

For any configuration not listed in the $ valet links command, you can remove them by using the rm command. For example:

$ rm acme-domain.test

And that’s it. Remember you may need to repeat this whenever you remove a project that’s no longer linked.