Policy precedence and override rules
When more than one policy of the same type applies to a resource, NGINX Ingress Controller uses precedence rules to decide which policy takes effect.
Policy precedence goes from broader scope to narrower scope:
VirtualServer.spec.policiesVirtualServer.route.policiesVirtualServerRoute.subroute.policies
If the same policy type appears at multiple levels, the more specific level wins. For example:
- Route-level
accessControloverrides spec-levelaccessControl. - Subroute-level
corsoverrides route-levelcors.
For Ingress:
- Policies apply to the whole Ingress.
- With mergeable Ingress, minion policies override master policies of the same type.
See the policy type reference for the fields and merging behavior of each policy type.