I have built an api where YARP has been integrated and hosted in two web servers behind the LB . I'm facing challenges in invoking endpoints from this LB . Getting 404 error. But the same working fine whe executing through Visual Studio
Loading
I have built an api where YARP has been integrated and hosted in two web servers behind the LB . I'm facing challenges in invoking endpoints from this LB . Getting 404 error. But the same working fine whe executing through Visual Studio
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prasad RaveendranPosted Mar 16, 2025, 6:03 AM
YARP on IIS is challenging looks like. i may be missing something. :(
Eliana BlakePosted Mar 3, 2025, 3:27 AM
It sounds like you are encountering some challenges with invoking endpoints from a Load Balancer (LB) after deploying your .NET 8.0 Web API with YARP into IIS. The 404 error typically indicates that the requested resource was not found. Here are a few things you can check and troubleshoot to resolve this issue:
1. Ensure Correct Endpoint Configuration:
- Double-check that the endpoints are correctly configured in your YARP setup and that the LB is correctly routing traffic to the appropriate web servers.
- Verify that the URL being used to invoke the endpoints matches the actual endpoint routes in your API.
2. Check Routing Rules:
- Inspect the routing rules in your YARP configuration to ensure that they are correctly set up to route incoming requests to the intended destinations.
- Make sure that the LB configuration aligns with the routing rules defined in your YARP setup.
3. Check Load Balancer Configuration:
- Verify that the LB is forwarding incoming requests to the correct servers and that there are no misconfigurations causing the 404 errors.
- Check if there are any specific rules or settings in the LB that might be affecting the routing to your API endpoints.
4. Logging and Debugging:
- Implement logging within your API application to trace the incoming requests and detect where the 404 errors are originating.
- Use debugging tools or network monitoring to inspect the requests and responses to identify any anomalies in the communication flow.
5. Security and Firewall Settings:
- Ensure that there are no firewall restrictions or security settings blocking incoming requests from the LB to your web servers.
- Check if there are any IP whitelisting or blacklisting rules that might be affecting the connectivity.
By systematically reviewing these areas, you should be able to pinpoint the root cause of the 404 errors when invoking endpoints from the LB. Identifying and resolving any misconfigurations or discrepancies in the setup will help ensure the smooth operation of your API deployment with YARP in an LB environment.