# Liboneagentproc.so appears to be rewriting nginx.conf in such a way to cause errors

**URL:** <https://community.dynatrace.com/t/liboneagentproc-so-appears-to-be-rewriting-nginx-conf-in-such-a-way-to-cause-errors/22757>\
**Category:** Extensions\
**Tags:** nginx, extensions\
**Created:** [December 17, 2019, 12:59am UTC](https://community.dynatrace.com/t/liboneagentproc-so-appears-to-be-rewriting-nginx-conf-in-such-a-way-to-cause-errors/22757 "2019-12-17T00:59:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_callahan](https://avatars.discourse-cdn.com/v4/letter/p/f17d59/32.png) [@paul\_callahan](https://community.dynatrace.com/u/paul_callahan)\
**Post date:** [December 17, 2019, 12:59am UTC](https://community.dynatrace.com/t/liboneagentproc-so-appears-to-be-rewriting-nginx-conf-in-such-a-way-to-cause-errors/22757/1 "2019-12-17T00:59:06Z")

</div>

We have custom nginx plugin that has a single directive that goes into nginx.conf. We usually place this directive right inside the http block.

```auto
http {
     tcell_app_id xxxxxxxx;
     ...

```

This works fine without Dynatrace.

Running with Dynatrace, we get a strange error from nginx:

```auto
# sh -x dynatrace-agent64.sh nginx -g "daemon off;"
...
nginx: [emerg] "tcell_app_id" directive is duplicate in /usr/local/openresty/nginx/conf/nginx.conf:19

```

Strange because that directive is not duplicated and this works fine without Dynatrace.

Now if I move our directive down a bit inside the http { block, the error goes away when running with Dynatrace.

```auto
http {
     ...
     ...
     tcell_app_id xxxxxxxx;
     server {

```

So something in Dynatrace appears to be processing or writing this file before startup, and it is causing problems with custom directives.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 17, 2019, 7:04am UTC](https://community.dynatrace.com/t/liboneagentproc-so-appears-to-be-rewriting-nginx-conf-in-such-a-way-to-cause-errors/22757/2 "2019-12-17T07:04:09Z")

</div>

Oneagent is modifying the configuration files at runtime (no persistent changes). As it causes issues with your NGINX configuration, I suggest opening a support ticket to get this investigated as this should not happen.

---

<div class="post-metadata">

**Author:** ![paul\_callahan](https://avatars.discourse-cdn.com/v4/letter/p/f17d59/32.png) [@paul\_callahan](https://community.dynatrace.com/u/paul_callahan)\
**Post date:** [December 17, 2019, 6:45pm UTC](https://community.dynatrace.com/t/liboneagentproc-so-appears-to-be-rewriting-nginx-conf-in-such-a-way-to-cause-errors/22757/3 "2019-12-17T18:45:24Z")

</div>

Actually, moving the directive doesn’t seem to make a difference. It seems to randomly work and then not work.
