1

I have two projects one is API(Laravel APP) and another one is a frontend app(Nuxt APP). I want to serve these projects on the same domain using valet on my local. Problem is that I'm not able to do so as both my subdomains are pointing to the frontend app(Nuxt APP). Following are the steps to reproduce the issue

Step 1:

Here each subdomain has been registered using the following commands and is pointing to the right directory,

valet link api.nuxttodo

valet link app.nuxttodo

Note: At this point, if I access api.nuxttodo.test it do successfully open the API(Laravel App)

Two links(sub-domains) that are generated after running these commands are as follows enter image description here

Step 2:

After that I have added a proxy for the app.nuxttodo.test domain using the command because my frontend app(Nuxt App) is running on http://localhost:60539

valet proxy app.nuxttodo http://localhost:60539

One proxy is as follows

enter image description here

Problem:

Now issue is that both subdomains are now pointing to the same project. Both api.nuxttodo.test and app.nuxttodo.test URL are now opening the frontend app(Nuxt APP) and I'm not able to access my API(Laravel App) which was accessible before running the proxy.

Muhammad Yasir
  • 406
  • 3
  • 15

1 Answers1

0

I'm running the same setup and I only used valet link in the Laravel directory.

For the Frontend project, I use valet proxy.

You should unlink the frontend valet unlink app.nuxttodo as that might be causing the issue.

Jerico Pulvera
  • 1,032
  • 7
  • 15