2

AWS API gateway HTTP proxy integration returns the following error when I tried to proxy to another URL.

Thu Jul 04 13:34:51 UTC 2019 : Sending request to https://api.example.com/{proxy}
Thu Jul 04 13:34:51 UTC 2019 : Execution failed due to configuration error: Illegal character in path at index 38: https://api.example.com/{proxy}
Thu Jul 04 13:34:51 UTC 2019 : Method completed with status: 500

The issue is with {proxy}. If that's removed, my API works perfectly. From AWS documentation, they have it the same as well, so i wasn't expecting any issue.

Has anyone met this issue before and how did you resolve it or is there anything else I need set or maybe set wrongly? Thanks.

2 Answers 2

1

Managed to resolve it after more debugging.

I was using Terraform to configure API gateway and i missed out to add request_parameters in both aws_api_gateway_method and aws_api_gateway_integration resources.

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

1 Comment

Thank you a lot! To be more specific on your answer, we should specify: In aws_api_gateway_method request_parameters = { "method.request.path.proxy" = true } In aws_api_gateway_integration request_parameters = { "integration.request.path.proxy" = "method.request.path.proxy" } Found example here: gist.github.com/mendhak/8303d60cbfe8c9bf1905def3ccdb2176
0

If this configuration is being imported from an open api 3 schema using terraform, then this is how it would look like:

/v2/{proxy+}:
    x-amazon-apigateway-any-method:
      parameters:
        - name: "proxy"
          in: "path"
          required: true
          type: "string"
      x-amazon-apigateway-integration:
        uri: "https://api.example.com/{proxy}"
        responses:
          default:
            statusCode: "401"
        requestParameters:
          integration.request.path.proxy: "method.request.path.proxy"
        connectionType: "INTERNET"
        httpMethod: "ANY"
        type: "http_proxy"

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.