You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the browser makes a request to /catalog/assets/styles.css, the proxy should send that request to https://catalog.foo.co/v1/assets/styles.css. I've tried multiple ways to configure the proxy, as shown in the SO post, but none of them work. I see no evidence that the requests are even reaching the proxy code, since I've added hooks like the one below without observing any console output:
onProxyReq: (proxyReq,req,res)=>{console.log("Hello I'm being proxied now! ",proxyReq,req,res);},
The server just responds with a 302. The proxy works fine for other routes I've defined, but I can't figure this one out.
I do have this proxy working using the request library with this code:
This discussion was converted from issue #386 on May 01, 2021 10:24.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is this a question?
Yes!
I made a StackOverflow post for this question but it's been over 2 weeks now with no response, so I'm hoping I can get some help here.
I have some dynamic route namespaces defined by a config file. A config entry looks like this:
When the browser makes a request to
/catalog/assets/styles.css
, the proxy should send that request tohttps://catalog.foo.co/v1/assets/styles.css
. I've tried multiple ways to configure the proxy, as shown in the SO post, but none of them work. I see no evidence that the requests are even reaching the proxy code, since I've added hooks like the one below without observing any console output:The server just responds with a 302. The proxy works fine for other routes I've defined, but I can't figure this one out.
I do have this proxy working using the
request
library with this code:I'm just not sure how to correctly adapt it to use the http-proxy-middleware. Help is appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions