title: Nginx- File upload via HTTP request
body: <p>I want to send an image file to my Nginx server(ubuntu machine).</p>
  
  <p>I add the following code to nginx.conf:</p>
  
  <pre><code>location /upload {
    auth_basic                 "Restricted Upload";
    auth_basic_user_file       basic.htpasswd;
    limit_except POST          { deny all; }
  
    client_body_temp_path      /tmp/;
    client_body_in_file_only   on;
    client_body_buffer_size    128K;
    client_max_body_size       1000M;
  
    proxy_pass_request_headers on;
    proxy_set_header           X-FILE $request_body_file; 
    proxy_set_body             off;
    proxy_redirect             off;
    proxy_pass                 http://backend/file;
  }
  </code></pre>
  
  <p>After adding that additional code, restart serivce failed.</p>
  
  <p>Where do i anything wrong?</p>
  
  <p>Thanks!</p>