Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Request POST Header Rewrite of Origin and Referer

CraigBo
Nimbostratus
Nimbostratus

Can someone tell me if the Origin and/or the Referer in the Request POST header and be rewritten before sending to the pool members?  If so, do you have a irule suggestion?  I've tried different irules i've found in devCentral that were close to what i needed but never affected the entries.  I've even tried deleting the Origin header in a HTTP profile and inserting it back the way i need it.  I just need to rewrite the Origin and Referer from HTTPS://123.abc.com to HTTP://123.abc.com.   

1 ACCEPTED SOLUTION

CA_Valli
MVP
MVP

 

when HTTP_REQUEST {
  if {[HTTP::method] eq "POST"}{
    HTTP::header replace origin "http://123.abc.com"
    HTTP::header replace referer "http://123.abc.com"
  } else { return }
}

 

This should do, but please test before installing. 

Also, you should be able to achieve the same with an LTM policy, which is recommended because it is faster and more importantly is fully supported within configuration changes like an upgrade since syntax is standard. 

iRule can be improved if you require support for multiple hosts

View solution in original post

3 REPLIES 3

CA_Valli
MVP
MVP

 

when HTTP_REQUEST {
  if {[HTTP::method] eq "POST"}{
    HTTP::header replace origin "http://123.abc.com"
    HTTP::header replace referer "http://123.abc.com"
  } else { return }
}

 

This should do, but please test before installing. 

Also, you should be able to achieve the same with an LTM policy, which is recommended because it is faster and more importantly is fully supported within configuration changes like an upgrade since syntax is standard. 

iRule can be improved if you require support for multiple hosts

Thanks, that worked perfectly!!  I think I may have been trying to make it to difficult.

ThatDeveloper
Nimbostratus
Nimbostratus

Hi @CraigBo 

This happens to be a recurring issue we faced with multiple reverse proxy solutions used at a startup I was working with. We ended up switching to a new provider which also turned out to be a cheap reverse proxy provider and was sophisticated enough for our varying use cases. the company is miniOrange and they sure are an underdog amongst the huge competitors like Nginx or F5. They services are cheaper and the 24/7 customer support is blazingly fast globally.

Here's link to check them out:  https://www.miniorange.com/reverse-proxy/

They were really helpful and patient in resolving our senior developer's queries.