Routing based on url

We currently have a three server setup:

  1. NGINX reverse proxy
  2. WordPress instance
  3. ASP.Net application

We use the NGINX reverse proxy to integrate the other two web services into one website.
Based on the URL, NGINX fetches the result from the WordPress server or the ASP.Net server.

These are the rules we configured:

  • Traffic to specific directories goes to the ASP.Net application
  • Pages with an aspx extension go to the ASP.Net application
  • All other traffic goes to the WordPress server

We are planning to implement Cloudflare because of security. However, the chain of requests would become larger and so would the latency since not all requests are cacheable.

So we are trying to figure out how we can implement Cloudflare so we can get rid of the current reverse proxy server. A Cloudflare sales rep said this could be done with the load balancing service.

I opened a free account to try the setup in a proof of concept. I bought the load balancing service on top but can’t seem to find any settings to configure routing between the servers.

Can it be done using the load balancing service?
Or do I need workers? If so, does anyone have an example?

With kind regards!

I’m not that familiar with the load balancer feature, but I don’t believe it supports different origins based on the url path/subdirectory.

The enterprise plan does support this in the form of a page rule, but I don’t imagine you’re looking into that. The solution others use for routing to different servers is Workers. Some examples are Host product blog as /blog subdirectory, and proxy it from the edge and

This topic was automatically closed after 14 days. New replies are no longer allowed.