# nginx.conf에 텍스트를 삽입하여 IP 로그를 부분적으로 익명화하기

**URL:** https://meta.discourse.org/t/insert-text-into-nginx-conf-to-partially-anonymize-ip-logs/259308
**Category:** Development
**Tags:** nginx
**Created:** [3월 24, 2023, 4:58오후 UTC](https://meta.discourse.org/t/insert-text-into-nginx-conf-to-partially-anonymize-ip-logs/259308 "2023-03-24T16:58:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DMTryptamines](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmtryptamines/32/295548_2.png) [@DMTryptamines](https://meta.discourse.org/u/DMTryptamines)
#### Post date: [3월 24, 2023, 4:58오후 UTC](https://meta.discourse.org/t/insert-text-into-nginx-conf-to-partially-anonymize-ip-logs/259308/1 "2023-03-24T16:58:21Z")

</div>

결국 nginx.conf 파일을 수정하여 아래 링크의 내용을 파일 끝에 삽입하고 싶습니다:

> **[Anonymizing Logs in NGINX and Apache](https://www.supertechcrew.com/anonymizing-logs-nginx-apache/)**
>
> How to anonymize logs in NGINX and Apache

app.yml에서 훅을 사용해야 한다는 것은 알지만, 정확히 어떻게 작동하는지 이해하기 어렵습니다. 더 중요한 것은, replace 명령을 사용하는 방법에 대한 문서나 유용한 게시물을 검색해 보았지만 아무것도 찾지 못했습니다. 제가 잘못된 용어를 사용하고 있는 것 같습니다.

아래는 누군가가 같은 일을 하려고 시도했던 게시물이지만, 저장소의 예제는 오히려 더 혼란스럽게 만듭니다.

> [@How can I update nginx.conf without resetting it on rebuild?](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102):
>
> Hi, I have a question - How can I update nginx.conf or discourse.conf without having it reset when the container is rebuilt? I edit the file using nano, save it. But when I rebuild the app, the original file is there instead of the updated one. Can someone help please? flushed

여기서 무엇을 해야 하는지, 또는 이를 수행하는 방법에 대한 문서를 어디서 찾을 수 있는지 아는 분이 있을까요?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [3월 24, 2023, 5:19오후 UTC](https://meta.discourse.org/t/insert-text-into-nginx-conf-to-partially-anonymize-ip-logs/259308/2 "2023-03-24T17:19:42Z")

</div>

nginx 설정을 수정하는 예시를 확인하려면 [discourse\_docker/templates/web.template.yml at main · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/blob/main/templates/web.template.yml) 을 살펴보세요.

보통 저는 yml 파일을 수정하기 전에 컨테이너 내부에서 설정 파일을 직접 수정하여 테스트합니다. 변경 사항이 제대로 적용되었는지 확인하려면 재빌드하는 데 시간이 오래 걸리기 때문입니다.
