Hi,
you do not need to create a dedicated VS but use the following irule on the APM virtual server:
when RULE_INIT {
set static::apm_local us-1.company.com
}
when HTTP_REQUEST {
if {[HTTP::host] equals vpn.company.com } {
HTTP::respond 302 Location "https://$static::apm_local[HTTP::uri]"
}
in this configuration, GTM will load balance to both datacenter, then the irule will redirect to the local URL.
another advice, your irule does not need
ACCESS::restrict_irule_events disable
, and disabling irule restriction may cause different behavior. do not use this command if not necessary.
this command allow to raise events like HTTP_REQUEST even for APM URI :