Forum Discussion
Mic_108850
Altostratus
May 10, 2010host header presented to origin server
Hello,
I have one server (x.x.x.x) in a "pool1"
i'm using a virtual server "VS1" calling this "pool1"
i created a web_app and a class_profile attache to the VS1.
the origin server (x.x.x.x) is using virtual host. This is one of the virtual host accepted: "game.domain.com"
This is my goal:
Client (http://testgame.domain.com) > cache.mydomain.com (VS1 Ip) > x.x.x.x (pool1)
How to present game.domain.com to the origin server when a client is calling testgame.domain.com ?
- hoolio
Cirrostratus
Hi Mic,when HTTP_REQUEST { Replace the Host header with game.domain.com HTTP::header replace Host "game.domain.com" }
- Mic_108850
Altostratus
Thanks Aaoronwhen HTTP_REQUEST { if { [HTTP::header "Host"] eq "game1.domain.com" } { HTTP::header replace Host org-game1.domain.com } if { [HTTP::header "Host"] eq "game2.domain.com" } { HTTP::header replace Host org-game2.domain.comm } }
- hoolio
Cirrostratus
That should work to rewrite the Host header based on what the client requested. You could also use a switch statement:when HTTP_REQUEST { switch [string tolower [HTTP::header "Host"]] { "game1.domain.com" { HTTP::header replace Host org-game1.domain.com } "game2.domain.com" { HTTP::header replace Host org-game2.domain.com } } }
- Mic_108850
Altostratus
ok i'm going to try it ,thank you
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects