If you recieve a 301 "Permanently Moved" error code while trying to call an API through the API Manager it is probably due to an error in the configuration of the API. The reverse proxy siting in front of the API Manager workers are configured to redirect all HTTP traffic to HTTPS. We need to make sure that the publisher is configured to accept HTTPS. Whether or not your API back-end accepts HTTPS, the API Manager should be configured to only accept HTTPS. Then the API Manager will call your back end through HTTP if necessary. The following steps will help you resolve the issue and update the API Manager correctly.
How to fix
- Check the URL that you are calling (and that the API Manager provides on the store) for https://. If the url uses http:// instead of https:// then the problem lies in the publisher.
- Note: If the URL you are using does start with https:// then this guide will not help resolve your issue. Please contact the the API Manager team for more help.
- Go the the API Publisher, find the API that is affected and open it.
- Click the edit button at the top of the page.
- Note: If the API effected is not your own please do not continue. Notify the API owner and point them to this article so that they can resolve the issue.
- Go to the third step of the publisher, "Manage"
- One of the options listed on this page is the "Transport Protocols". There are two options, http, and https. You should select only HTTPS.
- Note: This option only refers to the communication transport that should be used between the API Manager and the consumer. This option in no way affects the communication between WSO2 and your back-end service.
- Even if your API back-end is HTTP only, you must select HTTPS for this setting in the publisher. This will not affect the API Manager's communication with your back-end.
- Click "Save and Publish"
- Allow 15 minutes for your changes to propagate to the gateway workers.
If these steps have not resolved your issue and after 15 minutes you are still receiving the same errors, please contact the the API Manager team (email@example.com).