Closed ardilgulez closed 7 years ago
Can you double check your nginx configuration, also check the actual HTTP verb that nginx sends to Japronto. Maybe you are doing some redirection in NGINX that turns your POST to GET.
I don't do http method conversion in my nginx. In fact, I'm using the same nginx configuration for a handful of other applications, all of which handle POST requests, I encountered this type error with no other one of them.
Anyway, I found what was causing this: When I redirect from nginx as:
location /application {
proxy_pass http://127.0.0.1:8088
}
It fails to route to app.router.add_route('/', request_handler)
But when I switch my nginx routing to:
location /application {
proxy_pass http://127.0.0.1:8088/application
}
and handle that in my japronto app as app.router.add_route('/application', request_handler)
, suddenly it's all fine.
if you want the original behaviour without changing routes you need to use terminating slashes explicitely:
location /application/ {
proxy_pass http://127.0.0.1:8088/
}
Note the terminating /
in location
and proxy_pass
Hey,
I have the simplest possible application. The code is:
When I send a POST request with body to localhost:8088, the body is correctly parsed. But when I send a POST request to localhost/application (which is an nginx proxy), what I get is:
What can I do about this?
Thanks in advance.