# Problem serving terrain files in IIS

**URL:** https://community.cesium.com/t/problem-serving-terrain-files-in-iis/7005
**Category:** CesiumJS
**Created:** [June 10, 2018, 10:18am UTC](https://community.cesium.com/t/problem-serving-terrain-files-in-iis/7005 "2018-06-10T10:18:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![qed](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/qed/32/2184_2.png) [@qed](https://community.cesium.com/u/qed)
#### Post date: [June 10, 2018, 10:18am UTC](https://community.cesium.com/t/problem-serving-terrain-files-in-iis/7005/1 "2018-06-10T10:18:06Z")

</div>

I have success with my own generated height map and orthophoto to view in Cesium.

The development machine was using Apache as the web server.

To serve out the \*.terrain files, this was added to .htaccess file.

\<filesMatch “(.\*).terrain$”\>

ForceType application/octet-stream

Header set Content-Disposition attachment

Header set Content-Encoding: gzip

However for deployment, the client’s server requires using IIS as the web server. The error that appear are

An error occurred in “E”: Failed to obtain terrain tile X: 0 Y: 0 Level: 0.

An error occurred in “E”: Failed to obtain terrain tile X: 1 Y: 0 Level: 0.

I have tried the following:

1. add “” to web.config file

2. use " " to web.config as specified in cesium download.

3. point directly to “[http://myurl/elevation/0/0/0.terrain](http://myurl/elevation/0/0/0.terrain)” and “[http://myurl/elevation/0/1/0.terrain](http://myurl/elevation/0/1/0.terrain)”. The 0.terrain file will automatically be downloaded to the disk.

I believe it an issue of web.config to specify what to do with the terrain files to be similiar to .htaccess.

Any pointers is appreciated.

---

<div class="post-metadata">

### Author: ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)
#### Post date: [June 11, 2018, 3:35pm UTC](https://community.cesium.com/t/problem-serving-terrain-files-in-iis/7005/2 "2018-06-11T15:35:00Z")

</div>

Hi there,

Serving terrain requires a specific configuration for handling tile requests.

I would recommend creating a Cesium ion account and [uploading, processing, and serving your data](https://cesium.com/docs/tutorials/getting-started/) there.

Optionally, there is the [STK Terrain Server](http://help.agi.com/TerrainServer/GettingStarted.html) or other solutions for serving terrain.

Thanks,

Gabby

---

<div class="post-metadata">

### Author: ![Maurizio\_Sordo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/maurizio_sordo/32/5015_2.png) [@Maurizio\_Sordo](https://community.cesium.com/u/Maurizio_Sordo)
#### Post date: [May 15, 2021, 3:25pm UTC](https://community.cesium.com/t/problem-serving-terrain-files-in-iis/7005/3 "2021-05-15T15:25:28Z")

</div>

Change IIS configuration , adding “content-encoding” “gzip” in the header of subfolder (0-19) of terrain directory.  
Not in parent directory, because file like “layer.json” are not zipped.

Web.config in the foleter terrain\0 terrain\1 etc… is

\<?xml version="1.0" encoding="UTF-8"?\>
