1. 배경

Nginx 기동 시 아래와 같이 stream을 인식할 수 없다는 에러가 발생할 때.

nginx[31009]: nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:17

 2. 해결방법

stream 모듈을 설치한다.

아래 환경은 Amazon Linux (CentOS/Redhat 계정) 임.

$ sudo yum install nginx-mod-stream
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                     | 3.7 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package nginx-mod-stream.x86_64 1:1.20.0-2.amzn2.0.4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================
 Package                                  Arch                           Version                                      Repository                                 Size
======================================================================================================================================================================
Installing:
 nginx-mod-stream                         x86_64                         1:1.20.0-2.amzn2.0.4                         amzn2extra-nginx1                          87 k

Transaction Summary
======================================================================================================================================================================
Install  1 Package

Total download size: 87 k
Installed size: 172 k
Is this ok [y/d/N]: y
Downloading packages:
nginx-mod-stream-1.20.0-2.amzn2.0.4.x86_64.rpm                                                                                                 |  87 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:nginx-mod-stream-1.20.0-2.amzn2.0.4.x86_64                                                                                                       1/1
  Verifying  : 1:nginx-mod-stream-1.20.0-2.amzn2.0.4.x86_64                                                                                                       1/1

Installed:
  nginx-mod-stream.x86_64 1:1.20.0-2.amzn2.0.4

Complete!