Skip to content

Commit e796e8c

Browse files
committed
address more comments
1 parent 51c8435 commit e796e8c

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

content/nginxaas-azure/quickstart/disaster-recovery.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,38 @@ type:
88
---
99

1010

11-
This guide describes how to configure disaster recovery (DR) for F5 NGINX as a Service for Azure deployments in separate Azure regions, ensuring upstream access remains available even if a region fails. The deployment architecture ensures users can access backend application servers (upstreams) continuously from an alternative region if the primary region becomes unavailable. The solution leverages Terraform, Azure Virtual Network (VNet) peering, and unique subnets to support failover.
11+
This guide describes how to configure disaster recovery (DR) for F5 NGINX as a Service for Azure deployments in separate (ideally [paired](https://learn.microsoft.com/en-us/azure/reliability/regions-paired)) Azure regions, ensuring upstream access remains available even if a region fails. The deployment architecture ensures users can access backend application servers (upstreams) continuously from an alternative region if the primary region becomes unavailable. The solution leverages Terraform, Azure Virtual Network (VNet) peering, and unique subnets to support failover.
1212

1313
---
1414

1515
**Architecture Overview**
1616

17-
```
18-
+-------------------+ +-------------------+
19-
| Region 1 | | Region 2 |
20-
| VNet1 | | VNet2 |
21-
| +-------------+ | Peered | +-------------+ |
22-
| | Subnet A1 | |<------->| | Subnet B | |
23-
| | NGINXaaS #1 | | | | NGINXaaS #2 | |
24-
| +-------------+ | | +-------------+ |
25-
| | Subnet A2 | | | |
26-
| | Upstreams | | | |
27-
| +-------------+ | | |
28-
+-------------------+ +-------------------+
17+
```mermaid
18+
graph LR
19+
%% Region 1
20+
subgraph Region_1 ["Region 1 (VNet1)"]
21+
A1["Subnet A1<br/>NGINXaaS #1"]
22+
A2["Subnet A2<br/>Upstreams"]
23+
end
24+
%% Region 2
25+
subgraph Region_2 ["Region 2 (VNet2)"]
26+
B1["Subnet B<br/>NGINXaaS #2"]
27+
B2["Subnet B<br/>Upstreams"]
28+
end
29+
%% Peering connection between regions
30+
Region_1 <-->|"Peered"| Region_2
31+
%% Node styles (updated colors)
32+
style Region_1 fill:#9bb1de,stroke:#4a90e2,stroke-width:2px
33+
style Region_2 fill:#9bb1de,stroke:#4a90e2,stroke-width:2px
34+
style A1 fill:#d9fade,stroke:#2e7d32,stroke-width:2px,color:#000
35+
style A2 fill:#e8f3fe,stroke:#3075ff,stroke-width:2px,color:#000
36+
style B1 fill:#d9fade,stroke:#2e7d32,stroke-width:2px,color:#000
37+
style B2 fill:#e8f3fe,stroke:#3075ff,stroke-width:2px,color:#000
38+
accDescr: Diagram showing two Azure regions side by side: Region 1 (VNet1) contains Subnet A1 with NGINXaaS #1 and Subnet A2 with upstreams. Region 2 (VNet2) contains Subnet B1 with NGINXaaS #2 and Subnet B2 with upstreams. A double-headed arrow labeled "Peered" connects the two regions, indicating VNet peering. The visual illustrates that upstreams in Region 1 and 2 can be accessed from either NGINX deployment across regions.
2939
```
3040

3141
- Each region has its own VNet, subnet, and NGINXaaS for Azure deployment.
32-
- VNet peering enables cross-region connectivity.
42+
- Cross region connectivity ensures that upstreams are reachable from either deployment. We use VNet peering in this guide to establish that connectivity.
3343
- Upstreams (for example, VMs) are accessible from either NGINX deployment.
3444

3545
---
@@ -42,8 +52,8 @@ This guide describes how to configure disaster recovery (DR) for F5 NGINX as a S
4252

4353
> **Note**: Each NGINX deployment **must run on separate subnets and non-overlapping address spaces**. This is critical for [Virtual Network (VNet) peering](https://learn.microsoft.com/en-us/azure/virtual-network/how-to-configure-subnet-peering) between the two regions. For example:
4454
>
45-
> - Region 1 (Virtual Network - 1 Address Space): `10.0.0.0/16`
46-
> - Region 2 (Virtual Network - 2 Address Space): `10.1.0.0/16`
55+
> - Region 1 (Primary Deployment's Virtual Network Address Space): `10.0.0.0/16`
56+
> - Region 2 (Secondary Deployment's Virtual Network Address Space): `172.16.0.0/16`
4757
4858
---
4959

@@ -59,16 +69,19 @@ resource "azurerm_virtual_network" "deployment_primary_vnet" {
5969
address_space = ["10.0.0.0/16"]
6070
# other config...
6171
}
72+
6273
resource "azurerm_subnet" "deployment_primary_subnet" {
6374
address_prefixes = [cidrsubnet("10.0.0.0/16", 8, 0)] # results in 10.0.0.0/24
6475
}
6576
77+
6678
# Region 2
6779
resource "azurerm_virtual_network" "deployment_secondary_vnet" {
68-
address_space = ["10.1.0.0/16"]
80+
address_space = ["172.16.0.0/16"]
6981
}
82+
7083
resource "azurerm_subnet" "deployment_secondary_subnet" {
71-
address_prefixes = [cidrsubnet("10.1.0.0/16", 8, 0)] # results in 10.1.0.0/24
84+
address_prefixes = [cidrsubnet("172.16.0.0/16", 8, 0)] # results in 172.16.0.0/24
7285
}
7386
```
7487
---
@@ -85,6 +98,7 @@ resource "azurerm_nginx_deployment" "deployment_primary_nginxaas" {
8598
subnet_id = azurerm_subnet.deployment_primary_subnet.id
8699
}
87100
}
101+
88102
resource "azurerm_nginx_deployment" "deployment_secondary_nginxaas" {
89103
name = var.name_secondary
90104
resource_group_name = var.resource_group_secondary
@@ -108,6 +122,7 @@ resource "azurerm_virtual_network_peering" "vnet_primary_to_vnet_secondary" {
108122
virtual_network_name = azurerm_virtual_network.deployment_primary_vnet.name
109123
remote_virtual_network_id = azurerm_virtual_network.deployment_secondary_vnet.id
110124
}
125+
111126
resource "azurerm_virtual_network_peering" "vnet_secondary_to_vnet_primary" {
112127
name = "peering-vnet-secondary-to-vnet-primary"
113128
resource_group_name = var.resource_group_secondary
@@ -135,9 +150,9 @@ resource "azurerm_subnet" "upstreams" {
135150

136151
---
137152

138-
## Step 5: NGINX Configuration for Failover
153+
## Step 5: NGINXaaS Configuration for Failover
139154

140-
Configure both NGINX deployments to include upstreams from the primary regions in their load balancing configuration. Example `nginx.conf` snippet:
155+
Configure both NGINXaaS deployments to include upstreams from the primary region in their corresponding NGINX configuration. Example `nginx.conf` snippet:
141156

142157
```nginx
143158
upstream backend {
@@ -174,7 +189,7 @@ az network vnet peering create \
174189
--local-subnet-names <subnet1> \
175190
--remote-subnet-names <subnet2>
176191
```
177-
192+
> **Note**: As of May 2025, subnet peering is not available by default for all subscriptions. To use this feature, you must have the subscription on which you want to configure subnet peering be registered with Azure. Please review the configuration details and limitations in this [document](https://learn.microsoft.com/en-us/azure/virtual-network/how-to-configure-subnet-peering).
178193
179194
---
180195

0 commit comments

Comments
 (0)