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.