# KIBANA Can't Download GeoJSON Map Even After Enabling CORS

**URL:** https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897
**Category:** Kibana
**Created:** [February 4, 2019, 5:07am UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897 "2019-02-04T05:07:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![upchair](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/upchair/32/20893_2.png) [@upchair](https://discuss.elastic.co/u/upchair)
#### Post date: [February 4, 2019, 5:07am UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897/1 "2019-02-04T05:07:23Z")

</div>

Hello all,

I am trying to create a custom regional map in Kibana. I have imported the necessary GeoJSON map into Kibana. I have also joined the proper field in the GeoJSON file to match the appropriate field in the corresponding Elastic Search index pattern.

However, I keep getting the following error :

**Cannot download [http://localhost:8000/Liberian\_Counties.geojson](http://localhost:8000/Liberian_Counties.geojson) file. Please ensure the CORS configuration of the server permits requests from the Kibana application on this host**.

I have enabled CORS in the Elastic Search YML file but the error still persists.

My Kibana Configuration Settings for the custom map is shown below:

## Custom Region Maps

regionmap:  
layers:  
- name: "Liberian Counties"  
url: "[http://localhost:8000/Liberian\_Counties.geojson](http://localhost:8000/Liberian_Counties.geojson)"  
# attribution: "[https://exploratory.io/maps](https://exploratory.io/maps)"  
fields:  
- name: "CNAME2K"  
description: "County Name"

My Elastic Search Configuration Settings for enabling CORS is shown below:

**http.cors.enabled:true**

**http.cors.allow-origin: /https?://localhost(:[0-9]+)?/**

I haved also checked the values in both the elasticsearch index pattern and the values in the GeoJSON file to ensure that they are exactly the same. However, the error still persists.

I would be grateful if anyone could please help to solve this problem as I am at a crossroad.

Thank You.

Richard

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [February 4, 2019, 7:54pm UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897/2 "2019-02-04T19:54:11Z")

</div>

Kibana can not use Elasticsearch as the web server for GeoJSON files. You should host your GeoJSON files using an external web server such as the [http-server](https://www.npmjs.com/package/http-server) Node.js library. There are more [details in this blog post](https://www.elastic.co/blog/custom-region-maps-in-kibana-6-0).

---

<div class="post-metadata">

### Author: ![upchair](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/upchair/32/20893_2.png) [@upchair](https://discuss.elastic.co/u/upchair)
#### Post date: [February 6, 2019, 1:46pm UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897/3 "2019-02-06T13:46:55Z")

</div>

@nickpeihl Hi,

Thanks for your mail. I already hosted my geojson files via http server from Day 1. However, the error still persists.

I hosted my GeoJSON file with the following http-server in the same directory as my GEOJSON file as was instructed on the elastic search website using the following command line statement :

**http-server --cors='\*' -p 8000**

I would be grateful if you could help with a solution.

Thank You

Richard

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [February 6, 2019, 7:11pm UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897/4 "2019-02-06T19:11:45Z")

</div>

Can you try `http-server --cors="kbn-version" -p 8000` and see if that helps? I think recent versions of http-server are more strict about accepting headers.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 6, 2019, 7:11pm UTC](https://discuss.elastic.co/t/kibana-cant-download-geojson-map-even-after-enabling-cors/166897/5 "2019-03-06T19:11:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
