cancel
Showing results for 
Search instead for 
Did you mean: 

Can I put a service on Stingray into maintenance mode?

SOLVED
riverbedjo
Contributor

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?

1 ACCEPTED SOLUTION

Accepted Solutions
owen
Frequent Contributor

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

View solution in original post

1 REPLY 1
owen
Frequent Contributor

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