Replies: 1 comment
-
Your html might be using absolute urls. Try modifying the html response and changing the absolute urls to absolute paths with responseInterceptor. |
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
-
I'm trying to setup a proxy to from my main site to another url which has additional features (which will eventually replace the main site in time). I'm trying to make the transition seamless so the url in the browser shouldn't change so a redirect can't be used.
e.g. mymainsite.com/othersite is being proxied to theothersite.com via
app.use('/othersite', createProxyMiddleware('http://theothersite.com', {logLevel: 'debug', changeOrigin: true}))
I can see when I hit mymainsite.com/othersite in my browser, the index.html from theothersite.com is being served but the static files (js, css, images etc) required to make it render are not being served (404 error). the browser is looking for them on the mymainsite.com and not on theothersite.com where they would normally be found e.g.
http://mymainsite.com/static/js/bundle.js but the actual file is found here http://theothersite.com/static/js/bundle.js
How should static resources like this be handled? is this even possible?
thanks in advance for any help and advice,
Chris.
Beta Was this translation helpful? Give feedback.
All reactions