Welcome! Log In Create A New Profile

Advanced

File upload fail with nginx and backend tomcat

Posted by rightgenius 
File upload fail with nginx and backend tomcat
December 19, 2011 04:49AM
I am novice in deploying apps. And these days I get exhausted with the nginx for reverse proxy.
I use nginx as the reverse proxy and tomcat to deal with the request.
Html is OK.
Commons-fileupload is used to receive the file uploaded.
It works if I directly visit tomcat on 8080, but fail when I visit nginx on 80.
I tried to upload a small picture (4k) but failed.
The request has been passed to the app in tomcat, but the commons-fileupload cannot parse out the picture in the http body. And it doesn't throw any exception. The client sees the http code 200, but the file doesn't get uploaded.

Here is the configuration of nginx.
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_heder Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Via "nginx"
proxy_redirect off;
}

I also post the question in stackoverflow but it seems nobody can help.
http://stackoverflow.com/questions/8551443/apache-commons-fileupload-fail-to-parse-the-file-with-tomcat-proxyed-by-nginx

Is anyone here can find out the problem or mistake?
Thank you.
Re: File upload fail with nginx and backend tomcat
July 25, 2013 01:25PM
Hi there,

I am running into similar issue. Did you ever find a solution?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready