> For the complete documentation index, see [llms.txt](https://docs.plura.io/ko/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plura.io/ko/faq/siem/modplura/nginx.md).

# Nginx 수동 설치

## 1. 사전 조사 <a href="#id-1" id="id-1"></a>

Nginx의 실행 상태, 설정 파일 경로, 프로세스 소유자 등을 확인하여 환경을 점검합니다.

### 1-1. Nginx 실행 여부 확인 <a href="#id-1-1" id="id-1-1"></a>

```bash
ps -ef | grep nginx
```

```
 nginx 실행파일 경로/ 명령 파라미터 확인 (=readlink /proc/$(pid)/exe)

 nginx 설정파일 경로 확인 (nginx -t)

 nginx process owner 확인
```

### 1-2. 서비스 등록 상태 확인 <a href="#id-1-2" id="id-1-2"></a>

```bash
service nginx status
```

### 1-3. Nginx 설정 리로드 <a href="#id-1-3" id="id-1-3"></a>

```bash
service nginx reload
```

```bash
nginx -s
```

### 1-4. 설정 파일 확인 <a href="#id-1-4" id="id-1-4"></a>

Nginx의 주요 설정 파일 경로를 확인하고, 필요한 경우 설정을 추가합니다.

* 표준 설정 파일 경로

```bash
/etc/nginx/nginx.conf
```

* 설정 파일에서 `http { }` 블록 내부에 다음 설정이 있는지 확인합니다.

```bash
http {
 include conf.d/*.conf
 …
}
```

* 만약 `include conf.d/*.conf` 라인이 없다면, 해당 라인을 추가합니다.
* 설정 파일 경로에 `conf.d` 디렉터리가 없는 경우, 다음 명령어로 생성합니다.

```bash
mkdir -p /etc/nginx/conf.d
```

## 2. 표준 설치: PLURA 모듈 및 설정 파일 추가 <a href="#id-2" id="id-2"></a>

Nginx 표준 설치 경로에 PLURA 설정 파일을 다운로드하여 추가합니다.

```bash
curl https://repo.plura.io/v4/module/nginx/plura.conf -o /etc/nginx/conf.d/plura.conf
```

* `plura.conf` 파일이 추가되면, `http { }` 블록 내부에 `access_log` 지시어가 설정되어 웹로그가 자동으로 생성됩니다.

## 3. 사용자 정의 설치: 수동 설정 추가 <a href="#id-3" id="id-3"></a>

{% hint style="warning" %}
사용자 정의 설정의 경우, `server { }` 블록 내에 이미 `access_log` 지시어가 존재할 수 있습니다. \
이 경우, 상위 블록인 `http { }` 블록의 `access_log` 설정이 무시될 수 있으므로, 수동으로 설정을 추가합니다.
{% endhint %}

* 수동 설정 추가 예시
  * `server { }` 블록에 다음 라인을 추가하여 웹로그 경로를 명시합니다.

```
server {
    access_log /var/log/plura/weblog.log mod_plura;
}
```

## 4. 정보 등록 <a href="#id-4" id="id-4"></a>

설치가 완료되면, 다음 명령어를 통해 PLURA 모듈 정보를 `/etc/modplura` 파일에 등록합니다.

```bash
echo ModPlura-Nginx > /etc/modplura
```

```bash
echo 5.5.0 >> /etc/modplura
```

```bash
echo /usr/sbin/nginx >> /etc/modplura
```

```bash
echo /etc/nginx >> /etc/modplura
```

```bash
touch /etc/.modplura
```

## 5. 권한 설정 <a href="#id-5" id="id-5"></a>

{% hint style="warning" %}
PLURA 웹 로그 생성 디렉토리의 소유자를 Nginx 워커 프로세스 소유자와 동일하게 설정하고, 권한을 조정합니다.
{% endhint %}

```bash
chown nginx /var/log/plura
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.plura.io/ko/faq/siem/modplura/nginx.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
