For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Kuldeep22's avatar
Kuldeep22
Icon for Altostratus rankAltostratus
Jan 09, 2024

Change HTTP header for request

I have mentioned in system's host file vip ip & fqdn as like 20.10.20.30 abc.com, after that I want to access abc.com but in http header information should be dvwa.com like I have put the url abc.com in browser but page should be visible in abc.com but in http header info should be af dvwa.com

3 Replies

  • This is fairly confusing.  Using host files - will only make things more confusing and near impossible to troubleshoot down the road.   You should only modify a host file as a quick test -and put it back - and us a proper DNS entry.

    That being said - can we assume the "systems " host file entry is the client side - and not either the f5- or the backed server?   This would result in the client side computer making calls to abc.com -which should translate to 20.10.20.30.   from the client with modified host file   ping 20.10.20.30    <---will NOT do a nslookup,  it will see the entry in the host file and use that.

    The next step is to ping dvwa.com and make sure that comes back to the same ip ( or what ever you are expecting).

    Lasty - i believe you a look for either a url rewrite - or a header re-write.

    https://community.f5.com/t5/technical-forum/how-to-do-http-header-replace-with-irule/td-p/118808
    or if its more complex - and you want to detect the IP - and make the change from there
    https://my.f5.com/manage/s/article/K000130245

     

  • Always wonder why with such requests? Is it that dificult to setup another virtual host on the webserver behind the BIG-IP?

  • I really like to use LTM policies instead of irules for these simple requirements.

    Just replace 'host' header with the following ltm policy below and assign it to your virtual server.