# New Feature: Basic HTTP response header modification

**URL:** <https://community.fly.io/t/new-feature-basic-http-response-header-modification/3594>\
**Category:** General\
**Tags:** announcement\
**Created:** [January 5, 2022, 1:29pm UTC](https://community.fly.io/t/new-feature-basic-http-response-header-modification/3594 "2022-01-05T13:29:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [January 5, 2022, 1:29pm UTC](https://community.fly.io/t/new-feature-basic-http-response-header-modification/3594/1 "2022-01-05T13:29:10Z")

</div>

We’ve just released a way to modify your HTTP response headers in a limited, but useful, fashion.

Essentially, this new features allows you to either **add** or **remove** headers via `fly.toml` like so:

```toml
[[services.ports]]
handlers = ["http"]
port = "80"
# here it is
http_options = { response = { headers = { to-add = "value", to-remove = false } } }

```

In this case, the `to-add: value` would be added to the response headers. The `to-remove` header would be removed from the final response our proxy sends to your users.

You can use the new `http_options.response.headers` map to:

#### Add a header

```toml
# add the header `my-header: value` to HTTP responses
http_options = { response = { headers = { my-header = "value" } } }

```

or for multiple-values headers

```toml
# depending on the HTTP version, the header output will be different
http_options = { response = { headers = { my-header = ["value1", "value2"] } } }

```

#### Remove a header

```toml
# remove the `via` header (automatically added by Fly)
http_options = { response = { headers = { via = false } } }

```

---

<div class="post-metadata">

**Author:** ![josephabrahams](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/josephabrahams/32/3100_2.png) [@josephabrahams](https://community.fly.io/u/josephabrahams)\
**Post date:** [April 17, 2022, 1:55am UTC](https://community.fly.io/t/new-feature-basic-http-response-header-modification/3594/2 "2022-04-17T01:55:32Z")

</div>

Hey @jerome, do you have any more info on this feature? Specifically do you know if it’s possible to remove the `fly-request-id` and change `server` header? I can’t seem to get consistent results with the above code.

Thanks,  
Joseph

---

<div class="post-metadata">

**Author:** ![zhengyutay](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zhengyutay/32/3015_2.png) [@zhengyutay](https://community.fly.io/u/zhengyutay)\
**Post date:** [October 27, 2023, 7:52pm UTC](https://community.fly.io/t/new-feature-basic-http-response-header-modification/3594/3 "2023-10-27T19:52:43Z")

</div>

Just want to know if we can add runtime environment to the response header like fly machine id?
