# Configuring Access-Control-Allow-Origin

**URL:** <https://discuss.ipfs.tech/t/configuring-access-control-allow-origin/2369>\
**Category:** Help\
**Created:** [March 21, 2018, 11:05am UTC](https://discuss.ipfs.tech/t/configuring-access-control-allow-origin/2369 "2018-03-21T11:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theHour](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@theHour](https://discuss.ipfs.tech/u/theHour)\
**Post date:** [March 21, 2018, 11:05am UTC](https://discuss.ipfs.tech/t/configuring-access-control-allow-origin/2369/1 "2018-03-21T11:05:37Z")

</div>

Hi,

I’m playing with ipfs and js-ipfs-api but I’m having problems with configuring Access-Control-Allow-Origin header.  
I’ve followed the instructions from official documentation and also from [https://github.com/INFURA/tutorials/wiki/IPFS-and-CORS](https://github.com/INFURA/tutorials/wiki/IPFS-and-CORS) (I’ve set the \* instead of some url)but when I try to use js api and read the file I get the following error:

Failed to load [https://ipfs.infura.io:5001/api/v0/cat?arg=QmYzWWCvYhqU6d5VvRvVwgbpqM9J3HH8TMbns9UvFSSvBf&stream-channels=true:](https://ipfs.infura.io:5001/api/v0/cat?arg=QmYzWWCvYhqU6d5VvRvVwgbpqM9J3HH8TMbns9UvFSSvBf&stream-channels=true:) The ‘Access-Control-Allow-Origin’ header has a value ‘null’ that is not equal to the supplied origin. Origin ‘null’ is therefore not allowed access. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Any help is really appreciated!

---

<div class="post-metadata">

**Author:** ![VictorBjelkholm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/victorbjelkholm/32/10_2.png) [@VictorBjelkholm](https://discuss.ipfs.tech/u/VictorBjelkholm)\
**Post date:** [March 21, 2018, 3:35pm UTC](https://discuss.ipfs.tech/t/configuring-access-control-allow-origin/2369/2 "2018-03-21T15:35:34Z")

</div>

Is your gateway deployed at `ipfs.infura.io`? That seems to be the public gateways that Infura runs, maybe not the one you have running yourself?

Could you post an example of how you are using js-ipfs-api exactly?

---

<div class="post-metadata">

**Author:** ![theHour](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@theHour](https://discuss.ipfs.tech/u/theHour)\
**Post date:** [March 21, 2018, 4:47pm UTC](https://discuss.ipfs.tech/t/configuring-access-control-allow-origin/2369/3 "2018-03-21T16:47:27Z")

</div>

Hey Victor, thanks for your response but I found what was the problem.  
I am ashamed to say this, but the problem was the way I’ve opened my html file ☹ .  
Since I was not serving the file from server Access-Control-Allow-Origin headers value was “null”.  
I’ve used surge.sh for quick test and it works like a charm.
