# 添加到路由头？

**URL:** https://meta.discourse.org/t/add-to-route-headers/111929
**Category:** Support
**Created:** [2019年三月18日 14:10 UTC](https://meta.discourse.org/t/add-to-route-headers/111929 "2019-03-18T14:10:34Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![Dev\_Work](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dev_work/32/124200_2.png) [@Dev\_Work](https://meta.discourse.org/u/Dev_Work)
#### Post date: [2019年三月26日 06:34 UTC](https://meta.discourse.org/t/add-to-route-headers/111929/13 "2019-03-26T06:34:31Z")

</div>

Happened!! 🙂

> [@Add a custom HTTP header to requests made to your Discourse](https://meta.discourse.org/t/how-to-add-a-custom-http-header-to-your-discourse/26439):
>
> Add this to your app.yml: ## Remember, this is YAML syntax - you can only have one block with a name run: - exec: echo "Beginning of custom commands" # A man's not dead while his name is still spoken. - replace: filename: "/etc/nginx/conf.d/discourse.conf" from: /location \/ {/ to: | location / { add\_header X-Clacks-Overhead "GNU Terry Pratchett"; Make sure to rebuild the container afterwards. play_button Terry Pratchett, author of the Discworld novels, …

```plaintext
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: /sendfile on;/
     to: |
       add_header Cache-Control "no-store";
       add_header Pragma "no-cache";
       sendfile on;

```

---

_[View the full topic](https://meta.discourse.org/t/add-to-route-headers/111929)._
