Skip to content

Commit 5eb6e7a

Browse files
committed
Freshness review
1 parent 671b7bf commit 5eb6e7a

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

articles/iot-edge/how-to-configure-api-proxy-module.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to customize the API proxy module for IoT Edge gateway hi
55
author: PatAltimore
66

77
ms.author: patricka
8-
ms.date: 06/12/2024
8+
ms.date: 07/11/2025
99
ms.topic: concept-article
1010
ms.service: azure-iot-edge
1111
services: iot-edge
@@ -16,50 +16,50 @@ ms.custom: [amqp, mqtt]
1616

1717
[!INCLUDE [iot-edge-version-all-supported](includes/iot-edge-version-all-supported.md)]
1818

19-
This article walks through the configuration options for the API proxy module, so you can customize the module to support your gateway hierarchy requirements.
19+
This article describes the configuration options for the API proxy module, so you can customize the module to support your gateway hierarchy requirements.
2020

21-
The API proxy module simplifies communication for IoT Edge devices when multiple services are deployed that all support HTTPS protocol and bind to port 443. This is especially relevant in hierarchical deployments of IoT Edge devices in ISA-95-based network-isolated architectures like those described in [Network isolate downstream devices](how-to-connect-downstream-iot-edge-device.md#network-isolate-downstream-devices) because the clients on the downstream devices can't connect directly to the cloud.
21+
The API proxy module simplifies communication for IoT Edge devices when multiple services use the HTTPS protocol and bind to port 443. This setup is especially relevant in hierarchical deployments of IoT Edge devices in ISA-95-based network isolated architectures, like those described in [Network isolate downstream devices](how-to-connect-downstream-iot-edge-device.md#network-isolate-downstream-devices), because clients on downstream devices can't connect directly to the cloud.
2222

23-
For example, to allow downstream IoT Edge devices to pull Docker images requires deploying a Docker registry module. To allow uploading blobs requires deploying an Azure Blob Storage module on the same IoT Edge device. Both these services use HTTPS for communication. The API proxy enables such deployments on an IoT Edge device. Instead of each service, the API proxy module binds to port 443 on the host device and routes the request to the correct service module running on that device per user-configurable rules. The individual services are still responsible for handling the requests, including authenticating and authorizing the clients.
23+
For example, letting downstream IoT Edge devices pull Docker images requires deploying a Docker registry module. Letting devices upload blobs requires deploying an Azure Blob Storage module on the same IoT Edge device. Both services use HTTPS for communication. The API proxy module enables these deployments on an IoT Edge device. Instead of each service binding to port 443, the API proxy module binds to port 443 on the host device and routes requests to the correct service module running on that device based on user-configurable rules. The individual services are still responsible for handling requests, including authenticating and authorizing clients.
2424

25-
Without the API proxy, each service module would have to bind to a separate port on the host device, requiring a tedious and error-prone configuration change on each child device that connects to the parent IoT Edge device.
25+
Without the API proxy, each service module must bind to a separate port on the host device, which requires a tedious and error-prone configuration change on each child device that connects to the parent IoT Edge device.
2626

2727
>[!NOTE]
28-
>A downstream device emits data directly to the Internet or to gateway devices (IoT Edge-enabled or not). A child device can be a downstream device or a gateway device in a nested topology.
28+
>A downstream device sends data directly to the Internet or to gateway devices (IoT Edge-enabled or not). A child device can be a downstream device or a gateway device in a nested topology.
2929
3030
## Deploy the proxy module
3131

32-
The API proxy module is available from the [Microsoft Container Registry (MCR)](https://mcr.microsoft.com/product/azureiotedge-api-proxy/tags) and the image URI is `mcr.microsoft.com/azureiotedge-api-proxy:latest`. You can deploy the module using the [Azure portal](how-to-deploy-modules-portal.md) or [Azure CLI](how-to-deploy-modules-cli.md).
32+
The API proxy module is available from the [Microsoft Container Registry (MCR)](https://mcr.microsoft.com/product/azureiotedge-api-proxy/tags), and the image URI is `mcr.microsoft.com/azureiotedge-api-proxy:latest`. Deploy the module using the [Azure portal](how-to-deploy-modules-portal.md) or [Azure CLI](how-to-deploy-modules-cli.md).
3333

3434
## Understand the proxy module
3535

36-
The API proxy module leverages an nginx reverse proxy to route data through network layers. A proxy is embedded in the module, which means that the module image needs to support the proxy configuration. For example, if the proxy is listening on a certain port then the module needs to have that port open.
36+
The API proxy module uses an nginx reverse proxy to route data through network layers. The module has an embedded proxy, so the module image needs to support the proxy configuration. For example, if the proxy listens on a certain port, the module needs to have that port open.
3737

38-
The proxy starts with a default configuration file embedded in the module. You can pass a new configuration to the module from the cloud using its [module twin](../iot-hub/iot-hub-devguide-module-twins.md). Additionally, you can use environment variables to turn configuration settings on or off at deployment time.
38+
The proxy starts with a default configuration file embedded in the module. Pass a new configuration to the module from the cloud using its [module twin](../iot-hub/iot-hub-devguide-module-twins.md). You can also use environment variables to turn configuration settings on or off at deployment time.
3939

40-
This article focuses first on the default configuration file, and how to use environment variables to enable its settings. Then, we discuss customizing the configuration file at the end.
40+
This article first covers the default configuration file and how to use environment variables to enable its settings. It then explains how to customize the configuration file.
4141

4242
### Default configuration
4343

44-
The API proxy module comes with a default configuration that supports common scenarios and allows for customization. You can control the default configuration through environment variables of the module.
44+
The API proxy module comes with a default configuration that supports common scenarios and lets you customize it. Control the default configuration through the module's environment variables.
4545

4646
Currently, the default environment variables include:
4747

4848
| Environment variable | Description |
4949
| -------------------- | ----------- |
50-
| `PROXY_CONFIG_ENV_VAR_LIST` | List all the variables that you intend to update in a comma-separated list. This step prevents accidentally modifying the wrong configuration settings. |
51-
| `NGINX_DEFAULT_TLS` | Specifies the list of TLS protocols to be enabled. See NGINX's [ssl_protocols](https://nginx.org/docs/http/ngx_http_ssl_module.html#ssl_protocols).<br><br>Default is 'TLSv1.2'. |
52-
| `NGINX_DEFAULT_PORT` | Changes the port that the nginx proxy listens to. If you update this environment variable, you must expose the port in the module dockerfile and declare the port binding in the deployment manifest. For more information, see [Expose proxy port](#expose-proxy-port).<br><br>Default is 443.<br><br>When deployed from the Azure Marketplace, the default port is updated to 8000, to prevent conflicts with the edgeHub module. For more information, see [Minimize open ports](#minimize-open-ports). |
50+
| `PROXY_CONFIG_ENV_VAR_LIST` | List all the variables you want to update in a comma-separated list. This step helps prevent accidentally changing the wrong configuration settings. |
51+
| `NGINX_DEFAULT_TLS` | Sets the list of TLS protocols to enable. See NGINX's [ssl_protocols](https://nginx.org/docs/http/ngx_http_ssl_module.html#ssl_protocols).<br><br>Default is 'TLSv1.2'. |
52+
| `NGINX_DEFAULT_PORT` | Changes the port that the nginx proxy listens on. If you update this environment variable, expose the port in the module dockerfile and declare the port binding in the deployment manifest. For more information, see [Expose proxy port](#expose-proxy-port).<br><br>Default is 443.<br><br>When deployed from the Azure Marketplace, the default port changes to 8000 to prevent conflicts with the edgeHub module. For more information, see [Minimize open ports](#minimize-open-ports). |
5353
| `DOCKER_REQUEST_ROUTE_ADDRESS` | Address to route docker requests. Modify this variable on the top layer device to point to the registry module.<br><br>Default is the parent hostname. |
5454
| `BLOB_UPLOAD_ROUTE_ADDRESS` | Address to route blob registry requests. Modify this variable on the top layer device to point to the blob storage module.<br><br>Default is the parent hostname. |
5555

5656
## Minimize open ports
5757

58-
To minimize the number of open ports, the API proxy module should relay all HTTPS traffic (port 443), including traffic targeting the edgeHub module. The API proxy module is configured by default to re-route all edgeHub traffic on port 443.
58+
To minimize open ports, set the API proxy module to relay all HTTPS traffic (port 443), including traffic for the edgeHub module. By default, the API proxy module reroutes all edgeHub traffic on port 443.
5959

60-
Use the following steps to configure your deployment to minimize open ports:
60+
Follow these steps to set up your deployment to minimize open ports:
6161

62-
1. Update the edgeHub module settings to not bind on port 443, otherwise there will be port binding conflicts. By default, the edgeHub module binds on ports 443, 5671, and 8883. Delete the port 443 binding and leave the other two in place:
62+
1. Update the edgeHub module settings so it doesn't bind to port 443. Otherwise, you get port binding conflicts. By default, the edgeHub module binds to ports 443, 5671, and 8883. Delete the port 443 binding and leave the other two in place:
6363

6464
```json
6565
{
@@ -82,8 +82,8 @@ Use the following steps to configure your deployment to minimize open ports:
8282

8383
1. Configure the API proxy module to bind on port 443.
8484

85-
1. Set value of the **NGINX_DEFAULT_PORT** environment variable to `443`.
86-
1. Update the container create options to bind on port 443.
85+
1. Set the value of the **NGINX_DEFAULT_PORT** environment variable to `443`.
86+
1. Update the container create options to bind to port 443.
8787

8888
```json
8989
{
@@ -99,13 +99,13 @@ Use the following steps to configure your deployment to minimize open ports:
9999
}
100100
```
101101

102-
If you don't need to minimize open ports, then you can let the edgeHub module use port 443 and configure the API proxy module to listen on another port. For example, the API proxy module can listen on port 8000 by setting the value of the **NGINX_DEFAULT_PORT** environment variable to `8000` and creating a port binding for port 8000.
102+
If you don't need to minimize open ports, let the edgeHub module use port 443 and set the API proxy module to listen on another port. For example, set the **NGINX_DEFAULT_PORT** environment variable to `8000` and create a port binding for port 8000.
103103

104104
## Enable container image download
105105

106-
A common use case for the API proxy module is to enable IoT Edge devices in lower layers to pull container images. This scenario uses the [Docker registry module](https://hub.docker.com/_/registry) to retrieve container images from the cloud and cache them at the top layer. The API proxy relays all HTTPS requests to download a container image from the lower layers to be served by the registry module in the top layer.
106+
A common use case for the API proxy module is to let IoT Edge devices in lower layers pull container images. This scenario uses the [Docker registry module](https://hub.docker.com/_/registry) to get container images from the cloud and cache them at the top layer. The API proxy relays all HTTPS requests to download a container image from the lower layers to the registry module in the top layer.
107107

108-
This scenario requires that downstream IoT Edge devices point to the domain name `$upstream` followed by the API Proxy module port number instead of the container registry of an image. For example: `$upstream:8000/azureiotedge-api-proxy:1.1`.
108+
In this scenario, downstream IoT Edge devices point to the domain name `$upstream` followed by the API proxy module port number instead of the container registry of an image. For example, `$upstream:8000/azureiotedge-api-proxy:1.1`.
109109

110110
This use case is demonstrated in the tutorial [Create a hierarchy of IoT Edge devices using gateways](tutorial-nested-iot-edge.md).
111111

@@ -165,7 +165,7 @@ Configure the following module on any **lower layer** for this scenario:
165165

166166
## Expose proxy port
167167

168-
Port 8000 is exposed by default from the docker image. If a different nginx proxy port is used, add the **ExposedPorts** section declaring the port in the deployment manifest. For example, if you change the nginx proxy port to 8001, add the following to the deployment manifest:
168+
Port 8000 is exposed by default from the Docker image. If you use a different nginx proxy port, add the **ExposedPorts** section to declare the port in the deployment manifest. For example, if you change the nginx proxy port to 8001, add the following to the deployment manifest:
169169

170170
```json
171171
{
@@ -186,9 +186,9 @@ Port 8000 is exposed by default from the docker image. If a different nginx prox
186186

187187
## Enable blob upload
188188

189-
Another use case for the API proxy module is to enable IoT Edge devices in lower layers to upload blobs. This use case enables troubleshooting functionality on lower layer devices like uploading module logs or uploading the support bundle.
189+
Another use case for the API proxy module is letting IoT Edge devices in lower layers upload blobs. This use case lets you troubleshoot lower layer devices, like uploading module logs or the support bundle.
190190

191-
This scenario uses the [Azure Blob Storage on IoT Edge](https://hub.docker.com/r/microsoft/azure-blob-storage) module at the top layer to handle blob creation and upload. In a nested scenario, up to five layers are supported. The *Azure Blob Storage on IoT Edge* module is required on the top layer device and optional for lower layer devices. For a sample multi-layer deployment, see the [Azure IoT Edge for Industrial IoT](https://github.com/Azure-Samples/iot-edge-for-iiot) sample.
191+
This scenario uses the [Azure Blob Storage on IoT Edge](https://hub.docker.com/r/microsoft/azure-blob-storage) module at the top layer to handle blob creation and upload. In a nested scenario, up to five layers are supported. The *Azure Blob Storage on IoT Edge* module is required on the top layer device, but it's optional for lower layer devices. For a sample multi-layer deployment, see the [Azure IoT Edge for Industrial IoT](https://github.com/Azure-Samples/iot-edge-for-iiot) sample.
192192

193193
Configure the following modules at the **top layer**:
194194

@@ -242,10 +242,10 @@ Configure the following module on any **lower layer** for this scenario:
242242
}
243243
```
244244

245-
Use the following steps to upload the support bundle or log file to the blob storage module located at the top layer:
245+
Follow these steps to upload the support bundle or log file to the blob storage module at the top layer:
246246

247-
1. Create a blob container, using either Azure Storage Explorer or the REST APIs. For more information, see [Store data at the edge with Azure Blob Storage on IoT Edge](how-to-store-data-blob.md).
248-
1. Request a log or support bundle upload according to the steps in [Retrieve logs from IoT Edge deployments](how-to-retrieve-iot-edge-logs.md), but use the domain name `$upstream` and the open proxy port in place of the blob storage module address. For example:
247+
1. Create a blob container using Azure Storage Explorer or the REST APIs. For more information, see [Store data at the edge with Azure Blob Storage on IoT Edge](how-to-store-data-blob.md).
248+
1. Request a log or support bundle upload by following the steps in [Retrieve logs from IoT Edge deployments](how-to-retrieve-iot-edge-logs.md), but use the domain name `$upstream` and the open proxy port instead of the blob storage module address. For example:
249249

250250
```json
251251
{
@@ -259,11 +259,11 @@ Use the following steps to upload the support bundle or log file to the blob sto
259259

260260
## Edit the proxy configuration
261261

262-
A default configuration file is embedded in the API proxy module, but you can pass a new configuration to the module via the cloud using the module twin.
262+
A default configuration file is embedded in the API proxy module, but you can pass a new configuration to the module through the cloud by using the module twin.
263263

264-
When you write your own configuration, you can still use environment to adjust settings per deployment. Use the following syntax:
264+
When you write your own configuration, you can still use environment variables to adjust settings for each deployment. Use the following syntax:
265265

266-
* Use `${MY_ENVIRONMENT_VARIABLE}` to retrieve the value of an environment variable.
266+
* Use `${MY_ENVIRONMENT_VARIABLE}` to get the value of an environment variable.
267267
* Use conditional statements to turn settings on or off based on the value of an environment variable:
268268

269269
```conf
@@ -276,16 +276,16 @@ When you write your own configuration, you can still use environment to adjust s
276276
#endif_tag !${MY_ENVIRONMENT_VARIABLE}
277277
```
278278

279-
When the API proxy module parses a proxy configuration, it first replaces all environment variables listed in the `PROXY_CONFIG_ENV_VAR_LIST` with their provided values using substitution. Then, everything between an `#if_tag` and `#endif_tag` pair is replaced. The module then provides the parsed configuration to the nginx reverse proxy.
279+
When the API proxy module parses a proxy configuration, it first replaces all environment variables listed in the `PROXY_CONFIG_ENV_VAR_LIST` with their values by using substitution. Then, it replaces everything between an `#if_tag` and `#endif_tag` pair. The module then provides the parsed configuration to the nginx reverse proxy.
280280

281-
To update the proxy configuration dynamically, use the following steps:
281+
To update the proxy configuration dynamically, follow these steps:
282282

283-
1. Write your configuration file. You can use this default template as a reference: [nginx_default_config.conf](https://github.com/Azure/iotedge/blob/main/edge-modules/api-proxy-module/templates/nginx_default_config.conf)
283+
1. Write your configuration file. Use this default template as a reference: [nginx_default_config.conf](https://github.com/Azure/iotedge/blob/main/edge-modules/api-proxy-module/templates/nginx_default_config.conf).
284284
1. Copy the text of the configuration file and convert it to base64.
285285
1. Paste the encoded configuration file as the value of the `proxy_config` desired property in the module twin.
286286

287287
:::image type="content" source="./media/how-to-configure-api-proxy-module/change-config.png" alt-text="Screenshot that shows how to paste encoded config file as value of proxy_config property.":::
288288

289289
## Next steps
290290

291-
Use the API proxy module to [Connect a downstream IoT Edge device to an Azure IoT Edge gateway](how-to-connect-downstream-iot-edge-device.md).
291+
Use the API proxy module to [connect a downstream IoT Edge device to an Azure IoT Edge gateway](how-to-connect-downstream-iot-edge-device.md).

articles/iot-edge/iot-edge-limits-and-restrictions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ For more information, see [Create a gateway hierarchy](how-to-connect-downstream
3333

3434
IoT Hub enforces these restrictions:
3535

36-
* An 8 KB size limit on the value of tags.
37-
* A 32 KB size limit on both the value of `properties/desired` and `properties/reported`.
36+
* 8 KB size limit on the value of tags.
37+
* 32 KB size limit on both the value of `properties/desired` and `properties/reported`.
3838

3939
For more information, see [Module twin size](../iot-hub/iot-hub-devguide-module-twins.md#module-twin-size).
4040

0 commit comments

Comments
 (0)