title: CORS problem if "Content-type": "multipart/form-data"
body: <p>I have two domains (example.com for client, api.example.com for rest API) where I request from client to API considering CORS policy.
  Preflight request works as expected and every other requests (GET/POST/PUT/DELTE) work well except file upload, means if Content-type is "multipart/form-data".</p>
  
  <p>And I get following error in Chrome console:</p>
  
  <blockquote>
    <p>Access to XMLHttpRequest at '<a href="https://api.example.com/video/upload" rel="noreferrer">https://api.example.com/video/upload</a>' from origin '<a href="https://www.example.com" rel="noreferrer">https://www.example.com</a>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  </blockquote>
  
  <p>Here my client (vuejs) source:</p>
  
  <pre><code>var config = {
      headers: { "Content-Type": "multipart/form-data" },
      onUploadProgress(e) {
        if (e.lengthComputable) {
          self.percentage = Math.round(e.loaded / e.total * 100) + "%";
        }
      }
    };
  
    axios
      .post(apiUrl + `/video/upload`, formData, config)
      .then(response =&gt; {
        this.successes.push(
          response.data.videoName + " uploaded."
        );
      })
      .catch(e =&gt; {
        this.errors.push(message);
      });
  },
  </code></pre>
  
  <p>And nginx configuration for CORS:</p>
  
  <pre><code>server {
  listen 443 ssl default_server http2;
  listen [::]:443 ssl default_server ipv6only=on;
  root /var/www/example/public;
  index       index.php index.html index.htm;
  server_name api.example.com:443;
  
  add_header Access-Control-Allow-Origin "*" always;
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Content-Type-Options "nosniff";
  add_header Access-Control-Allow-Methods "GET, POST, PUT, OPTIONS,  DELETE";
  add_header Access-Control-Allow-Headers "Content-Type, X-Auth-Token, Origin, Authorization";
  </code></pre>
  
  <p>Could anyone please let me know what is wrong with this code &amp; configuration?!
  Appreciate any help!</p>