How to make Lambda + API Gateway obey REQUEST_URI?

52 Views Asked by At

I created an AWS Lambda with my application (a Web server) written in Rust Actix. I use https://crates.io/crates/lambda-web

Then I added this Lambda as the backend of an AWS HTTP API. The HTTP API has only $default stage.

https://XXX.execute-api.us-east-1.amazonaws.com/ produces correct result (what my packaged Web server outputs when the root is requested).

But https://XXX.execute-api.us-east-1.amazonaws.com/p/YYY produces: {"message":"Not Found"} what is surely not my Web server's output.

My task is to run the Web server in Lambda with path forwarded to the server in the normal way (as REQUEST_URI). So, when I request https://XXX.execute-api.us-east-1.amazonaws.com/p/YYY it should pass /YYY to my application. How?

0

There are 0 best solutions below