worker static assets
I am using static assets worker and it works fine in production - but in local I want to proxy any non matching paths to my 8080 port.
I am trying to match exmaple.com/login* --> it works.
now example.com/appname -> this doesn't proxy to my app server in local that's running on 8080
Unable to figure out which setting to use in toml.
2 Replies
wrangler doesn't simulate origin stuff
you could make your Worker fetch
http://localhost:8080
though when falling backthanks!! I tried to work around with proxy and it fails with this error now:
https://customer1.my.example.app:8787/
If I request for above
const url = new URL(request.url) -> this always returns my.example.app
So even my proxying is broken.
Is this a limitation in wrangler where we can't get full host url? I logged the whole of request in console and I don't find "customer1.my.example.app" anywhere
I really want my integration tests to work well and not have too much of config differences between prod and local.
The other way use Caddy or some reverse proxy and proxy /login paths to wrangler port and other paths to my local development server(origin server)
What do people do for making their integration tests work well and also ease the development burden on engineers?
I am new to all this. So learning a lot but the local dev kind of is getting ugly.
so basically in my worker code if it's not /login* then I am trying to proxy - which works fine in theory, but just that it doesn't have the real host with all the subdomain info in it. So that's a blocker for me.
@Walshy thank you and I asked more follow-up above. Just forgot to at mention. Sorry...