-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nginx Deployment | Post Requests #3327
Comments
GitMate.io thinks the contributor most likely able to help you is @asvetlov. Possibly related issues are #1392 (Issue with ClientSession.request('POST') method), #872 (proxying request.scheme with nginx), #161 (aiohttp can't send files by POST request correct), #187 (Request.POST preloading), and #1765 (request.post() ignores blank values). |
Try the Nginx configuration in the aiohttp docs: |
Still the same problem ... |
Looks like, the problem doesn't occur if I make the request over https. |
If you follow the individual requests, I'd guess you're going to see a 301 or 302 redirect from http to https. Those redirects will commonly change the request method to GET. |
Pretty sure @paxswill is on to something. Something that's returning a 301/302 should be returning a 307/308 (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections for a discussion of the difference). |
@rascalking perhaps you right, but hard to confirm without looking on the source code. Closing the issue, nothing to do here without more info. |
Long story short
I'm trying to use nginx as a reverse proxy for my aiohttp server. That works fine with get requests, but it seems like nginx overwrites all post requests to get requests.
For example I make a post request to my nginx server and it passes it to the aiohttp server. But the aiohttp server gets a get request instead of post.
I know this is a nginx problem, but I wasn't able to find a solution somewhere else ...
Expected behaviour
Aiohttp should get a post request when making a post request to the nginx server.
Actual behaviour
Aiohttp gets a get request.
Steps to reproduce
Run a aiohttp server on the port 8082 and create a post route.
Configure your nginx server like this:
Your environment
Ubuntu 16.04 LTS 64bit,
Nginx 1.10.3,
aiohttp 3.4.4
The text was updated successfully, but these errors were encountered: