vADC Forum

Reply
Contributor
Posts: 27
Registered: ‎05-08-2013
Accepted Solution

Can I put a service on Stingray into maintenance mode?

I usually use a htaccess file on my app server to redirect everyone but my ip to a maintenance.html page .... I was foolishly trying to do this with my app server behind Stingray traffic manager but of course it didn't work .... is there a way to do the same thing with traffic manager?

Frequent Contributor
Posts: 321
Registered: ‎11-29-2012

Re: Can I put a service on Stingray into maintenance mode?

Try the following request rule


$ip = request.getRemoteIP();


# Don't intercept requests from my IP address


if( $ip =="123.45.67.89" ) break;



http.sendResponse( "503 Too Busy", "text/plain",


  "Sorry. No one can serve you right now", "" );


There are lots of other things you could do rather than directly sending the response:


http.redirect( "http://en.wikipedia.org/wiki/Special:Random" );


Also, take a look at Using Stingray Traffic Manager as a Webserver.

Finally, you could continue to use your .htaccess solution if you passed the source IP address through to Apache, using mod_remoteip as described in IP Transparency: Preserving the Client IP address in Stingray Traffic Manager

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.