title: Nginx - Unable to upload files to /tmp
body: <p>I'm unable to upload files to /tmp using Nginx, php-fpm and Ubuntu 18.04. When the application tries to upload to /tmp/upload, it looks like nothing actually happens and no attempt to upload to that location has happened.</p>
  
  <p>I've checked for permission issues and anything in the logs but there was nothing. I've tried setting upload_store value to a folder outside of /tmp (/var/www/upload) and repeated the upload process. This worked as expected and upload has succeeded. I then tried to see if I wasn't getting permission errors in the logs by setting that folder to unreadable but when I've tried to upload to it I've got a regular Permission denied error.</p>
  
  <p>I've tried setting up a watcher on the folder:</p>
  
  <pre><code>inotifywait -m --format "%e %f" /tmp/upload
  </code></pre>
  
  <p>Which reported something like this when manually touching a file but nothing during upload:</p>
  
  <pre><code>CREATE test_file
  OPEN test_file
  ATTRIB test_file
  CLOSE_WRITE,CLOSE test_file
  </code></pre>
  
  <p>And this when I tried uploading to /var/www/upload:</p>
  
  <pre><code>CREATE 0000000173
  OPEN 0000000173
  MODIFY 0000000173
  CLOSE_WRITE,CLOSE 0000000173
  OPEN 0000000173
  ACCESS 0000000173
  CLOSE_NOWRITE,CLOSE 0000000173
  OPEN 0000000173
  ACCESS 0000000173
  CLOSE_NOWRITE,CLOSE 0000000173
  DELETE 0000000173
  </code></pre>
  
  <p>However, when watching /tmp/upload, I've got nothing. I've also tried uploading directly to /tmp with the same results. /tmp and /tmp/upload both have 777 permissions.</p>
  
  <p>Here's my nginx config for that location:</p>
  
  <pre><code>location = /setup/images/saveimages {
      upload_pass @accept;
      upload_store /tmp/upload;
      upload_set_form_field "$upload_field_name.name"         "$upload_file_name";
      upload_set_form_field "$upload_field_name.content_type" "$upload_content_type";
      upload_set_form_field "$upload_field_name.path"         "$upload_tmp_path";
      upload_pass_form_field "^photo[0-9]_label$";
  }
  </code></pre>
  
  <p>Weird thing is, this works flawlessly on local development and staging but not on production, so seems like a configuration issue. However, I'm unable to find any differences in configuration.</p>
  
  <p>Any ideas?</p>