Rewrite with a prefix in front of "api"

I have two backend server running. I want to reverse proxy to each server depend on the API call. The below is my current rewrite config. But it only works for the /api one but not /alert-hub/api. I always got 304 when calling any API with /alert-hub/api.

{
    "rewrites": [
        {
            "source": "/alert-hub/api/:match*",
            "destination": "https://dev-growpilot.croft-ai.com/alert-hub/api/:match*"
        },
        {
            "source": "/api/:match*",
            "destination": "https://dev-growpilot.croft-ai.com/api/:match*"
        },
        {
            "source": "/(.*)",
            "destination": "/"
        }
    ]
}

“Not Modified” and indicates that the client’s cached version of the resource is still valid.

A few things to check:

  • Look at the request headers in your browser’s Network tab
  • Check for If-None-Match or If-Modified-Since headers
  • Verify what caching headers your API is sending

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.