Set HTTP proxy
APPLIES TO: All API Management tiers
The proxy
policy allows you to route requests forwarded to backends via an HTTP proxy. Only HTTP (not HTTPS) is supported between the gateway and the proxy. Basic and NTLM authentication only.
Note
Set the policy's elements and child elements in the order provided in the policy statement. Learn more about how to set or edit API Management policies.
Policy statement
<proxy url="http://hostname-or-ip:port" username="username" password="password" />
Attributes
Attribute | Description | Required | Default |
---|---|---|---|
url | Proxy URL in the form of http://host:port . Policy expressions are allowed. |
Yes | N/A |
username | Username to be used for authentication with the proxy. Policy expressions are allowed. | No | N/A |
password | Password to be used for authentication with the proxy. Policy expressions are allowed. | No | N/A |
Usage
- Policy sections: inbound
- Policy scopes: global, workspace, product, API, operation
- Gateways: classic, v2, consumption, self-hosted, workspace
Example
In this example, named values are used for the username and password to avoid storing sensitive information in the policy document.
<proxy url="http://192.168.1.1:8080" username={{username}} password={{password}} />
Related policies
Related content
For more information about working with policies, see:
- Tutorial: Transform and protect your API
- Policy reference for a full list of policy statements and their settings
- Policy expressions
- Set or edit policies
- Reuse policy configurations
- Policy snippets repo
- Author policies using Microsoft Copilot in Azure
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for