How to "convert" a request into a 404? #593
-
I'm proxying multiple micro-frontends and api's in the proxy, but I have some issues with it. In order to get the micro-frontends working, I defined a catch all and let that redirect to some cluster. However, if I now navigate to something like "/api/notdefinedinproxy", I get a HTML response instead of some kind of error (all logical of course, the catch all causes this). I tried adding a special proxy configuration like "api/{*anything}" which works more or less, but I still have to define a cluster with a destination (if I remember correctly, you'll get some kind of 50x error).
Is this the only way my requirement is going to work, or is there another way? And what is the best way of returning that 404 (the above code is not working entirely)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
How about using a standard route instead of a proxy route?
By the way, middleware should only call Abort if they don't want the response to be sent. If they do want it to be sent then they should return early / not call next. |
Beta Was this translation helpful? Give feedback.
How about using a standard route instead of a proxy route?
By the way, middleware should only call Abort if they don't want the response to be sent. If they do want it to be sent then they should return early / not call next.