title: How to solve CORS policy problem for Strapi?
body: <h2>Problem about CORS policy : HELP</h2>
  <h3>Description</h3>
  <p>Hello everyone !</p>
  <p>I created a React app using Strapi for backend and I don't understand how to setup CORS policy.
  Strapi is on my online server, and I run React app on my local computer. When I tried to send a request with Axios, there is this problem :</p>
  <blockquote>
  <p>Access to XMLHttpRequest at 'http://xx.xx.xx.xx/players' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  </blockquote>
  <p>I created the middleware.js file at config folder as it says in the documentation : <a href="https://strapi.io/documentation/v3.x/concepts/middlewares.html#configuration-and-activation" rel="nofollow noreferrer">https://strapi.io/documentation/v3.x/concepts/middlewares.html#configuration-and-activation</a></p>
  <pre class="lang-js prettyprint-override"><code>module.exports = {
    load: {
      before: ['timer', 'responseTime', 'logger', 'cors', 'responses', 'gzip'],
      after: ['parser', 'router'],
    },
    settings: {
      cors: {
        enabled: true,
        origin: ['*']
      },
    },
  };
  </code></pre>
  <p>I've looked at all the forums and articles on the subject, I couldn't solve the problem.</p>
  <h3>System</h3>
  <ul>
  <li>Node.js version: v15.2.1</li>
  <li>Strapi version: 3.3.2 (Community)</li>
  </ul>