1 Answer
- Newest
- Most votes
- Most comments
1
You need your REST API B path parameter to be set like this /dev/{proxy+}
.
See here for the relevant documentation.
answered a month ago
Relevant content
- asked a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Thanks for response. Your suggestion can be used only if I create another resource in the REST API A with path /dev. But I using separate REST API B which I added to the API mapping with path /dev. Both do the same thing. Like your suggestion I added /dev/{proxy+} in REST API B, in this case I have to use the url app.example.com/dev/dev but still the same issue. Another thing worth mentioning is though js/css files return 200, the Content-Type is always text/html instead of application/javascript or text/css. Nginx in the EC2 side has no issue & mime types are properly configured there.
Under the resource you created (/dev/{proxy+} or just /{proxy+}) click on the method (e.g., ANY) and select the Integration request tab. Edit the Integration request settings and replace the Endpoint URL to be "http://<your_domain>/{proxy}" instead of just "http://<your_domain>" (note that it's proxy without plus sign) Deploy the API and wait few seconds for the configuration to to take affect. This will cause the API to maintain the original request path toward the backend server. Please update if this solves your problem.
This http://<your_domain>/{proxy} does the trick. Thanks a lot. We can close this.