Upload Issues with Nginx Reverse Proxy - Part 2

Tony Holmes atholmes at gmail.com
Wed Sep 17 18:59:13 MSD 2008

I am using nginx (0.6.29) on Freebsd 7 amd64 as a reverse proxy to back end
web sites. It works very well except for php based file uploads.

I googled and found mention of setting the max post/upload/body size on the
php and front end nginx.con and verified that they are correct:


upload_max_filesize = 2M
post_max_size = 3M
upload_tmp_dir = /tmp

nginx.conf: $server is pulled from a map, it maps the host name to backend

        location / {
                proxy_set_header Host           $host;
                proxy_set_header X-Real-IP      $remote_addr;
                proxy_set_header X-Forwarded-For        $remote_addr;
                proxy_redirect  off;
                proxy_pass      http://$server$request_uri;

                client_max_body_size    2M;
                client_body_buffer_size 2M;

                proxy_buffering         off;

                proxy_connect_timeout   5;
                proxy_send_timeout      90;
                proxy_read_timeout      120;

                proxy_pass_header Expires;
                proxy_pass_header Cache-Control;
                proxy_pass_header Last-Modified;
                proxy_pass_header ETag;
                proxy_pass_header Content-Length;


When I do the upload, the temp file does not end up in /tmp although I do
see that the folder is touched (time incremented to the time of the upload).

Am I missing anything simple? I'm stumped and been working on this on and
off for 4 days now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080917/d371c2dc/attachment.html>

More information about the nginx mailing list