title: Access to XMLHttpRequest at 'http://localhost:9999/hello/sali' from origin 'http://localhost:8090'
body: <p>I am trying to enable CORS wildcard on NGINX as the following:</p>
  
  <p><strong>nginx.conf</strong></p>
  
  <pre><code>worker_processes  auto;
  error_log         "/opt/bitnami/nginx/logs/error.log";
  pid               "/opt/bitnami/nginx/tmp/nginx.pid";
  
  events {
    worker_connections  1024;
  }
  
  http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format    main '$remote_addr - $remote_user [$time_local] '
    '"$request" $status  $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    access_log    "/opt/bitnami/nginx/logs/access.log";
    add_header    X-Frame-Options SAMEORIGIN;
  
    client_body_temp_path  "/opt/bitnami/nginx/tmp/client_body" 1 2;
    proxy_temp_path        "/opt/bitnami/nginx/tmp/proxy" 1 2;
    fastcgi_temp_path      "/opt/bitnami/nginx/tmp/fastcgi" 1 2;
    scgi_temp_path         "/opt/bitnami/nginx/tmp/scgi" 1 2;
    uwsgi_temp_path        "/opt/bitnami/nginx/tmp/uwsgi" 1 2;
  
    sendfile           on;
    tcp_nopush         on;
    tcp_nodelay        off;
    gzip               on;
    gzip_http_version  1.0;
    gzip_comp_level    2;
    gzip_proxied       any;
    gzip_types         text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    keepalive_timeout  65;
    ssl_protocols      TLSv1 TLSv1.1 TLSv1.2;
    client_max_body_size 80M;
    server_tokens off;
    include  "/opt/bitnami/nginx/conf/server_blocks/*.conf";
  
    # HTTP Server
    server {
      # port to listen on. Can also be set to an IP:PORT
      listen  8080;
  
      location / {
        add_header 'Access-Control-Allow-Origin' '*';
      }
  
      location /status {
        stub_status on;
        access_log   off;
        allow 127.0.0.1;
        deny all;
      }
    }
  }
  </code></pre>
  
  <p>When I trigger a request to the URL <code>http://localhost:9999/hello/sali</code> with the following method:</p>
  
  <pre><code>methods: {
    load_user(event) {
  
      console.log(this.$kc)
  
      const config = {
        headers: {Authorization: `Bearer ${this.$kc.token}`}
      };
  
      this.$axios.get('http://localhost:9999/hello/sali', config)
        .then((response) =&gt; {
          console.log(response)
        })
        .catch(() =&gt; {
          console.log("errro")
        })
    },
  </code></pre>
  
  <p>Then it shows me in the javascript console: </p>
  
  <p><a href="https://i.stack.imgur.com/JqDXL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JqDXL.png" alt="enter image description here"></a></p>
  
  <p>Looking at the Network section on Chromium:
  <a href="https://i.stack.imgur.com/9D1gY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9D1gY.png" alt="enter image description here"></a></p>
  
  <p>you can see, that <code>Access-Control-Allow-Origin</code> is set to <code>*</code></p>
  
  <p>What am I doing wrong?</p>
  
  <p>Hint: I am using <strong>NGINX Bitami</strong>.</p>