0

I have a backend providing a HTTPS Endpoint. It response to a GET Request which is expecting two parameters in the query string part of its URL.

I configured a HTTP API Gateway with a GET method and a route using the above endpoint as the integration target (also with GET method). For the needed parameter I added parameter mapping with overwriting static values (just for testing).

When I open the "invoke URL" of the API route in a browser, it will receive a 301 response (moved permanently) to the original endpoint, including the two parameters with their configured static values.

Is there a way, to prevent the rerouting?

I do not want the API client to be aware of the real endpoint, to avoid invoking it without the API Gateway. Furthermore the client should not become aware of the static parameter values.

When I use an AWS REST API Gateway, I could configure the two parameters in the "Integration Request" as "URL query string parameters" with static values. Invoking the "Invoke URL" with the route, it returns the content of the real HTTP endpoint with a 200 OK response. Additionally the client doesn't get to know the real endpoint nor the static value for the two parameters. This is exactly the behavior I like to accomplish with the HTTP API Gateway - any chance to configure it to work that way, too?

Furthermore, if I use an AWS HTTP API Gateway but use a Lambda function as the integrated backend (regardless if the function has an own invocation URL or not), the API URL is not changed / forwarded either.

1 Answer 1

0

I had a very similar problem to what you describe, and finally tracked it down today. In my scenario, I wanted to use API Gateway to deliver requests to a private EC2 instance running LAMP stack and WordPress, and needed access to a custom API at https://wordpress.example.com/api/product which is currently only accessible on our private network.

I finally found that Apache HTTPD is redirecting me to a path with a trailing / so it was trying to redirect me to https://wordpress.example.com/api/product/. I changed my Endpoint URL to have the trailing slash, and that resolved the redirecting issue.

Reference: https://stackoverflow.com/a/64533237/2329657

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.