Forum Discussion
Redirect
So this is what I'm trying to do... We have a production webpage (virtual server/pool) with basic health monitors. We have a maintenance webpage (virtual server/pool). So the application guys want to be able to change the header on the maintenance webpage to contain the word "down" and when that happens they want the production webpage to redirect to the maintenance webpage. And flip back over when they remove the word "down."
Any help would be much appreciated....
- nitassEmployeeis the example irule in sol6510 applicable?
- crush09_18103Nimbostratus
No. They want to have the word "down" in the header (really meaning they made the maintenance page they want available) on the maintenance VS and when that maintenance page is available they want the production VS to redirect to that very maintenance page.
- nitassEmployeee.g.
[root@ve10:Active] config b virtual prod list virtual prod { snat automap pool prodpool destination 172.28.19.79:80 ip protocol 6 rules myrule profiles { http {} tcp {} } } [root@ve10:Active] config b pool prodpool list pool prodpool { monitor all myhttp members 200.200.200.101:80 {} } [root@ve10:Active] config b monitor myhttp list monitor myhttp { defaults from http dest 172.28.19.89:80 reverse recv "down" send "GET /test.html HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n" } [root@ve10:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1} { HTTP::fallback "http://172.28.19.89" } } } [root@ve10:Active] config curl http://172.28.19.89/test.html down [root@ve10:Active] config b pool prodpool|grep -i pool POOL prodpool LB METHOD round robin MIN/CUR ACTIVE MEMBERS 0/0 +-> POOL MEMBER prodpool/200.200.200.101:80 inactive,down [root@ve10:Active] config curl -I http://172.28.19.79 HTTP/1.0 302 Found Location: http://172.28.19.89 Connection: close
- nitassEmployeeanother way.
[root@ve10:Active] config b virtual prod list virtual prod { snat automap pool prodpool destination 172.28.19.79:80 ip protocol 6 rules myrule profiles { http {} tcp {} } } [root@ve10:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[LB::status pool foo member 172.28.19.89 80] eq "up"} { HTTP::redirect "http://172.28.19.89" } } } [root@ve10:Active] config b pool foo list pool foo { monitor all myhttp members 172.28.19.89:80 {} } [root@ve10:Active] config b monitor myhttp list monitor myhttp { defaults from http dest 172.28.19.89:80 recv "down" send "GET /test.html HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n" } [root@ve10:Active] config curl http://172.28.19.89/test.html down [root@ve10:Active] config b pool foo|grep -i pool POOL foo LB METHOD round robin MIN/CUR ACTIVE MEMBERS 0/1 +-> POOL MEMBER foo/172.28.19.89:80 active,up [root@ve10:Active] config curl -I http://172.28.19.79 HTTP/1.0 302 Found Location: http://172.28.19.89 Server: BigIP Connection: Keep-Alive Content-Length: 0
- smp_86112CirrostratusI'm not sure I fully comprehend your requirements. But how about this -
- crush09_18103NimbostratusThat's exactly what I tried to do. Having issues with getting their header. Are you sure that we can apply a health monitor to a Virtual server that then points to another site (is that what the alias does?) also what about persistance? I'm told that even if the members are down, persistant connections will still go to them.
- smp_86112CirrostratusThe health monitor is applied to a Pool, not a Virtual Server. But yes, the Alias fields say, in effect, "check this ip address/port instead of the ip/port of the members in the pool where it's applied". But what I would do first is create a bogus pool with the maintenance members and apply the maintenance monitor there. That way, you're not fussing with the production pool.
- smp_86112CirrostratusThat's exactly what I tried to do. Having issues with getting their header.
- crush09_18103Nimbostratus
Everything with the redirect irule works. The problem is I cannot get the health monitor to work.
The app guys gave me this.
https://testmaint.xyz.com/getwebsit...x?env=test
If I go to this webpage with a Internet browser, it says "down" in the body.
GET / HTTP/1.1\nHost: testmaint.xyz.com/getwebsitestatus.aspx?env=test\nConnection: close\n\n\r\n
and a receive string
down
-------
Alias Address * All Addresses
BIG-IP 10.2.3 Build 112.0 Final
- nitassEmployeeGET / HTTP/1.1\nHost: testmaint.xyz.com/getwebsitestatus.aspx?env=test\nConnection: close\n\n\r\ncan you try this?
Recent Discussions
Related Content
* 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