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
To be honest, I am not sure if this really is a bug report, or a question or a discussion.
I am using http-proxy-middleware to proxy requests from an Angular app to a rest service. It was working fine when I had this setup in a kubernetes environment. However, I recently tried to move it to Azure App Services, but when my web app tries to invoke the rest service through the proxy, I get a 403 forbidden. However, I am able to hit that rest service directly using a browser and Postman.
Express: 4.17.1 http-proxy-middleware: 1.0.3
This is my code for the middleware:
// Note that the source (web app) has the same domain, i.e. mywebapp.azurewebsites.net,
// so I don't think it's a CORS issue.
let tgt= 'https://mytarget.azurewebsites.net';
let src = '/mysource';
app.use(src, createProxyMiddleware({target: tgt, logLevel: 'debug', xfwd: false, changeOrigin: false}));
Note: I don't see any debug messages, even though logLevel is debug
I have tried various combinations of xfwd, changeOrigin, http vs https, etc.
In that post, he has the same issue as me. In a comment, he mentions: "...but it seems like the problem is with the proxy implementation I'm using (http-proxy-middleware).
To resolve it I've created my own proxy functionality which do not have problems with 403 error."
So, I can try to write my own proxy, but I'd rather try to get this working if possible. I don't know if it's a configuration issue, or a code issue.
This discussion was converted from issue #494 on April 18, 2021 14:38.
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
-
Hi,
To be honest, I am not sure if this really is a bug report, or a question or a discussion.
I am using http-proxy-middleware to proxy requests from an Angular app to a rest service. It was working fine when I had this setup in a kubernetes environment. However, I recently tried to move it to Azure App Services, but when my web app tries to invoke the rest service through the proxy, I get a 403 forbidden. However, I am able to hit that rest service directly using a browser and Postman.
Express: 4.17.1
http-proxy-middleware: 1.0.3
This is my code for the middleware:
Note: I don't see any debug messages, even though logLevel is debug
I have tried various combinations of xfwd, changeOrigin, http vs https, etc.
The reason why I am submitting this issue, is because I read this post:
https://docs.microsoft.com/en-us/answers/questions/204366/azure-app-serivice-nodejs-proxy-403.html
In that post, he has the same issue as me. In a comment, he mentions:
"...but it seems like the problem is with the proxy implementation I'm using (http-proxy-middleware).
To resolve it I've created my own proxy functionality which do not have problems with 403 error."
So, I can try to write my own proxy, but I'd rather try to get this working if possible. I don't know if it's a configuration issue, or a code issue.
Any thoughts?
Thanks,
Brett
Beta Was this translation helpful? Give feedback.
All reactions