Forum Discussion

cbwagner_13922's avatar
cbwagner_13922
Icon for Nimbostratus rankNimbostratus
Apr 20, 2012

iRule and Host Headers

So with apache, you can list *.mydomain.com and apache will answer for all requests comming in that match the wildcard + mydomain.com. No such luck with IIS7. Is there anyway through iRules to match a wildcard domain, but keep the wildcard domain name in the URL (so the client doesn't know the difference) but pass the correct host header to the webservers.

 

 

so request for bloging.mydomain.com comes in.

 

The F5 passes www.mydomain.com to the webserver,

 

the webserver sees www.mydomain.com in its host header,

 

it passes back the next page, link, etc.

 

the F5 passes back the page, but displays the URL bloging.mydomain.com to the client...

 

 

possible? impossible?

1 Reply

  • e.g.

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b pool foo list
    pool foo {
       members 200.200.200.101:80 {}
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if { [HTTP::host] equals "bloging.mydomain.com" } {
          HTTP::header replace Host "www.mydomain.com"
       }
    }
    }
    
    [root@ve1023:Active] config  ssldump -Aed -nni 0.0 port 80
    New TCP connection 1: 172.28.19.251(54281) <-> 172.28.19.79(80)
    1334971345.3088 (0.0010)  C>S
    ---------------------------------------------------------------
    HEAD /something HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Host: bloging.mydomain.com
    Accept: */*
    
    ---------------------------------------------------------------
    
    New TCP connection 2: 200.200.200.10(54281) <-> 200.200.200.101(80)
    1334971345.3120 (0.0031)  C>S
    ---------------------------------------------------------------
    HEAD /something HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Host: www.mydomain.com
    Accept: */*
    
    ---------------------------------------------------------------