Insert text into nginx.conf to partially anonymize IP logs

Essentially I want to modify nginx.conf to insert text at the end of the file from the below link:

I understand I need to do this with a hook in app.yml but I’m having a hard time understanding exactly how this works. More importantly trying to Google this hasn’t resulted in any documentation on how to use the replace command or useful posts at all, I suspect I’m using the wrong terminology.

I did find the following post by someone attempting to do the same thing but the examples in the repo only leave me feeling more confused.

Anyone know what I need to do here or where I can find documentation on doing it?

Have a look at discourse_docker/web.template.yml at main · discourse/discourse_docker · GitHub for some examples of modifying the nginx config.

What I usually do is modify the config files by hand inside the container to test before making changes to the yml, as it takes a long time to rebuild to see if your changes worked.

2 Likes