title: Access-Control-Allow-Origin in NGINX with Subdomain
body: <p>I have the following NGINX Config (Server 1) and /private is a wordpress install:</p>
  
  <pre><code>location /private/ {
    include cloudflare;
    add_header Access-Control-Allow-Origin private.domainofserver2.com;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    proxy_pass http://private.domainofserver2.com/;
  }
  </code></pre>
  
  <p>When I access <a href="https://domainofserver1.com/private" rel="nofollow noreferrer">https://domainofserver1.com/private</a> I get the following error in my console </p>
  
  <p><code>Access to Font at 'https://private.domainofserver2.com/wp-content/themes/entrada/vendors/font-awesome/fonts/fontawesome-webfont.woff2?v=4.4.0' from origin 'https://private.domainofserver1.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested 
  resource. Origin 'https://domainofserver</code>.com' is therefore not allowed access.`</p>
  
  <p>My Wordpress (Server 2) Config is:</p>
  
  <pre><code># Allow access from all domains for webfonts.
  &lt;IfModule mod_headers.c&gt;
    &lt;FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$"&gt;
      Header set Access-Control-Allow-Origin "*"
    &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>How can I resolve my error as the above does not work</p>