Skip to content

shubhamnikam/yarp-reverse-proxy

Repository files navigation

Yarp Reverse Proxy

YARP is a library to help create reverse proxy servers that are high-performance, production-ready, and highly customizable.

Nuget package:

For more info:

Reverse Proxy Config:

  • Path: ./YarpDemo.API.ReverseProxy/appsettings.json
  "ReverseProxy": {
    "Routes": {
      "order-get": {
        "ClusterId": "order-web",
        "Match": {
          "Path": "/api/Order/GetAll"
        }
      },
      "order-create": {
        "ClusterId": "order-web",
        "Match": {
          "Path": "/api/Order/Create/{id}"
        }
      },
      "order-get-mobile": {
        "ClusterId": "order-mobile",
        "Match": {
          "Path": "/mobile/api/Order/GetAll"
        },
        "Transforms": [
          {
            "PathRemovePrefix": "/mobile"
          }
        ]
      },
      "order-create-mobile": {
        "ClusterId": "order-mobile",
        "Match": {
          "Path": "/mobile/api/Order/Create/{**catch-all}"
        },
        "Transforms": [
          {
            "PathRemovePrefix": "/mobile"
          }
        ]
      },
      "payment-get": {
        "ClusterId": "payment-web",
        "Match": {
          "Path": "/api/Payment/GetAll"
        }
      },
      "payment-create": {
        "ClusterId": "payment-web",
        "Match": {
          "Path": "/api/Payment/Create/{**catch-all}"
        }
      }
    },
    "Clusters": {
      "order-web": {
        "Destinations": {
          "destination-1": {
            "Address": "http://localhost:9001"
          }
        }
      },
      "order-mobile": {
        "Destinations": {
          "destination-1": {
            "Address": "http://localhost:9001"
          }
        }
      },
      "payment-web": {
        "Destinations": {
          "destination-1": {
            "Address": "http://localhost:9002"
          }
        }
      }
    }
  }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages