In this scenario, customer would like Gateway's REST Management Service to be available only via HTTP port 9443 and not port 8443.
API Gateway
By default, REST Management Service is published on port 8443 and 9443.
The restriction and/or port redirection can be done by network systems acting before the Gateway (e.g Firewalls, Load Balancer and so on...).
However, a quick workaround can be applied by modifying the REST Man service policy logic.
Here an example:
1 - In the beginning of the policy logic, we add Set Context Variable assertion to parse the local TCP port the incoming requests is coming from ( request.tcp.localPort )
2 - We can use Compare Expression assertion to compare the variable's value retrieved from point 1 and to add a rule that allows only port 9443
3 - Finally, we can make use of a Customise Error Response assertion to return a meaningful error or whatever error we wish to return back to the client.
The final policy changes should look like those highlighted below: