# Discourse headless?

**URL:** <https://meta.discourse.org/t/discourse-headless/137893>\
**Category:** Self-hosting\
**Created:** [January 6, 2020, 5:28pm UTC](https://meta.discourse.org/t/discourse-headless/137893 "2020-01-06T17:28:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [January 8, 2020, 1:02am UTC](https://meta.discourse.org/t/discourse-headless/137893/6 "2020-01-08T01:02:23Z")

</div>

You can do the necessary mangling on your app.yml file.

The app.yml file you have now should be ending like this:

```yaml
run:
  - exec: echo "Beginning of custom commands"
  ## blablabla
  - exec: echo "End of custom commands"

```

You can run replaces in the nginx file making it look like this

```yaml
run:
  - exec: echo "Beginning of custom commands"
  ## blablabla
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: "location @discourse {"
     to: |
       location @discourse {
       add_header AAA bbb;
  - exec: echo "End of custom commands"

```

There are several examples at [discourse\_docker/templates at master · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/tree/master/templates)

---

_[View the full topic](https://meta.discourse.org/t/discourse-headless/137893)._
