Replies: 1 comment
-
Gave this a go and it worked 😁:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature Request:
Adding fallback support to proxies to fall back to valet (or specify something else to fall back to) when the proxied host is not available.
Suggestion:
To the
valet proxy
command, adding a third argument forfallback
, or a--loopback
/--fallback
option to fall back to the valet loopback (http://127.0.0.1:60).Fallbacks appear to be possible in Nginx: https://serverfault.com/questions/765483/how-to-add-a-fallback-to-my-proxy-in-nginx/765498
Context/Use Case:
I have a Vue SPA in my Laravel project. The Laravel app can serve the SPA dist which is handy for local development when the Vue dev server is not running. This isn't complex to achieve:
frontend/dist/css
/frontend/dist/js
/frontend/dist/static
assets in the./public
folder.frontend/dist/index.html
.If we want
client.example.test
to proxy to the Vue dev server, we can do that with Valet:The problem is that now if we stop the Vue dev server,
client.example.test
will not serve the dist build anymore (as was previously set up), it will instead show an Nginx 502 error page.What would be an ideal solution is if
valet proxy
could accept an optional 3rd argument for fallback or an option for--loopback
/--fallback
to fall back to valet:Now:
The API requests aren't on the same subdomain, they're on
api.example.test
, so there's no weirdness there.Beta Was this translation helpful? Give feedback.
All reactions