Skip to main content

Remove Web Application Proxy Server From Cluster May 2026

WAP, particularly in Microsoft-centric environments (acting as a reverse proxy for Active Directory Federation Services - ADFS), is not a stateless load balancer. It holds specific configuration ties, certificate dependencies, and publishing rules. This guide provides a comprehensive, vendor-agnostic approach with specific emphasis on ADFS/WAP, NGINX, and HAProxy clusters.

- name: Gracefully remove WAP node from cluster hosts: wap_removal_target become: yes tasks: - name: Stop web application proxy service service: name: W3SVC state: stopped ignore_errors: yes - name: Remove server from load balancer pool via API (F5 example) uri: url: "https://lb-manager/mgmt/tm/ltm/pool/wap_pool/members" method: DELETE body: '"name":" ansible_default_ipv4.address :443"' headers: Authorization: "Bearer f5_token " delegate_to: localhost remove web application proxy server from cluster

- name: Clean ADFS trust (run on ADFS server) win_shell: | Remove-WebApplicationProxyEndpoint -TargetProxyFQDN " ansible_fqdn " delegate_to: adfs_internal_server Removing a web application proxy server from a cluster is not merely a matter of turning off a switch. It is a process of quiescing, disconnecting, cleaning, and validating . The difference between a professional team and an amateur one is visible in the post-removal state. - name: Gracefully remove WAP node from cluster

$proxy = Get-AdfsProxy -Name "wap-node-01.contoso.com" Remove-AdfsProxy -TargetProxy $proxy If you skip Step 2, the ADFS server will still attempt to send "relying party trust" updates to the removed proxy, causing event ID 364 and proxy sync timeouts in the event log. Scenario B: NGINX Reverse Proxy Cluster Assuming you have an active-passive or active-active cluster managed via a configuration management tool (Ansible, Puppet) or shared storage. $proxy = Get-AdfsProxy -Name "wap-node-01

# For Windows WAP Get-WebApplicationProxyApplication | Select-Object ExternalURL, BackendServerURL, ExternalCertificateThumbprint If your cluster sits behind a hardware or software load balancer (F5, AWS NLB, HAProxy), verify the health probe settings. Does the balancer use a simple TCP handshake, or does it probe a specific URL ( /wap/health )? Removing the node before updating the LB will cause traffic to route to a black hole. Part 2: Graceful Quiescing – Draining the Traffic A hard shutdown is the enemy of production stability. You must "drain" the node. 2.1 Stop New Sessions (The "Drain" Step) Instruct the load balancer or the proxy itself to stop accepting new connections while finishing existing ones.

# On the node being removed systemctl stop keepalived systemctl disable keepalived Before physically decommissioning, block port 443 on the node to ensure zero stray traffic:

# View current WAP endpoints Get-WebApplicationProxyEndpoint Remove-WebApplicationProxyEndpoint -TargetProxyFQDN "wap-node-01.contoso.com"