Forum Discussion

Ahmed_Mohsen's avatar
Ahmed_Mohsen
Icon for Nimbostratus rankNimbostratus
Oct 13, 2021

load balance using http methods

We have 1 read/write node and two Read-only nodes, so we want all the Get http requests to be distributed equally in them and all other requests like POST, Patch, Delete to be forwarded to read/write node 

 

Example :-

Node1 : R/W " it will receives Get , Post,Patch,Delete "

Node2 : Read-only "it will receives Get Requests only "

Node3 : Read-only "it will receives Get Requests only "

 

Thank you in advance

5 Replies

  • Hi Ahmed,

    Can you try this iRule?

    when HTTP_REQUEST {
    	if { [HTTP::method] ne "GET" } {
    		node node1ip port
    	}
    	# GET requests are forwarded to the default pool. No need to use else statement.
    }
    • Ahmed_Mohsen's avatar
      Ahmed_Mohsen
      Icon for Nimbostratus rankNimbostratus

      Thank you for your reply .

      Kindly when i use this iRule that's mean Node1 will not receives GET requests but it can receives " Post, Patch, Delete" requests  and F5 BIG-IP will continue Load balance GET Requests to Node2 and Node3 ? Please advice