티스토리 뷰

Web Server Load Balancing with NGINX Plus

 

(너무 긴 시간 동안 티스토리 업데이트를 안했더니, 끼갈나게 바뀐 티스토리 Editor가 어색하다. 매우 엄청난 기능에 고맙고 황송함도 플러스 )



반백살이 되어갈 동안 너무 IIS/Apche에만 의존해 온 것 같아 "끼깔나게 성능 좋(다고 알려져 있)다는 NginX를 배워보기로 했다. 

Ubuntu 리눅스 서버에 설치하는 것을 기준으로 대부분의 설명(구글링)이 나와있지만, 클라이언트의 시스템 환경이 Windows인 탓에, Windows 환경을 기준으로 구축/운영하는 방법을 기록해 두기로 한다. 

Nginx는 사용자의 요청에 의해 정적/동적인 웹 페이지를 반환하는 웹서버다. Nginx는 일반적인 HTTP의 웹서버의 역할 외에도 proxy, reverse proxy 서버의 역할 또한 가능해 매력적인 것 같다. Apache와 두드러지게 다른 특징을 가지고 있는데, Apache는 MPM(multi Processing Module: 다중 처리 모듈) 방식을 사용하는 반면, Nginx는 Event driven 방식을 통해 구동된다 (나중에 알게 된 것이지만 각각의 Event 처리를 담당할 Worker Process가 여러개 생성되어 동작한다) 

우선 웹 서버와 Event Driven 프로세스 처리에 탁월한 nginX의 기초 이해하기는, 아주 쉽게 잘 정리해 주신 이 분의 게시글을 참고 했다. (Ubuntu에 설치하려는 경우는 여기를 참고하도록 하자)


##### Windows server에 NginX 설치하기 (2020.12.08)

1. NginX 다운로드 & 설치 ( stable 1.18.0 선택 / mainline은 1.19.5)
nginx.org/en/download.html

 

nginx: download

 

nginx.org

Windows용 stable 버전을 선택하기로 한다.
 
2. (설치 후) 동작 테스트  
    http://localhost/ 
기본적으로 80포트로 설정되 있으므로 브라우저에서 실행해 본다 

NginX Command 
(설치 디렉터리로 이동 후 실행해야 한다) 

(시작) nginx.exe 
(종료) nginx.exe -s stop 
(재시작)  nginx.exe -s reload 

nginx -s [ stop | quit | reopen | reload ]


4. Third Party 모듈 설치  
www.nginx.com/resources/wiki/modules/

 

NGINX 3rd Party Modules | NGINX

NGINX 3rd Party Modules Below is a list of third-party modules for NGINX and NGINX Plus, created and maintained by members of the NGINX community. NGINX, Inc. does not provide support for these modules, so please reach out to each individual module develop

www.nginx.com

필자의 경우, 20만 정도의 회원을 보유한 온라인 학습 서비스 사이트를 구축/운영/유지보수하는 것으로, (늙은 이 나이까지도 다행히) 밥벌어 먹고 살고 있다. 

그래서 NginX용 3'rd party module은, IIS 기반으로 구성된 이 플랫폼을 완전히 대체한다고 가정했을 때 필요할 것으로/또는 유용할 것으로 보이는 모듈들을 선별해 봤다.  추천모듈...이라고 쓰지만 각자 운영하거나/목표하는 사이트에 따라 다를 수 있으니 위 사이트에서 참고해 보기 바란다. 

4.1) Audio Track for HTTP Live Streaming 
    :  Generate audio track for HTTP Live Streaming (HLS) streams on the fly
    https://www.nginx.com/resources/wiki/modules/audio_track/

4.2) Form Input
    : Parses HTTP POST request bodies and saves results to NGINX variables
   https://www.nginx.com/resources/wiki/modules/form_input/

4.3) Traffic Accounting
   : Realtime traffic and status code monitoring (HTTP + Stream)
    https://www.nginx.com/resources/wiki/modules/traffic_accounting/

4.4) Java
   : A module for embedding Clojure, Java, and Groovy programs
   https://www.nginx.com/resources/wiki/modules/java_handler/

4.5) MP4 Streaming Lite
   : Seeks time within H.264/MP4 files if a “start” parameter is in the URL
   https://www.nginx.com/resources/wiki/modules/mp4_streaming/

4.6) Secure Download
  : Create expiring links
 https://www.nginx.com/resources/wiki/modules/secure_download/

4.7) Upload
  : Handles file uploads using multipart/form-data encoding (RFC 1867)
   https://www.nginx.com/resources/wiki/modules/upload/

4.8) NGINX Upload Progress Module
   : Tracks and reports upload progress	
  https://www.nginx.com/resources/wiki/modules/upload_progress/

4.9) User Agent
   : A more powerful module than the native BrowserModule
  https://www.nginx.com/resources/wiki/modules/user_agent/

4.10) Zip
   : Assemble ZIP archives on the fly
https://www.nginx.com/resources/wiki/modules/zip/

열심히 설치하고 튜닝해 본 뒤에, 글쓰기를 이어나가야 겠다.

※ Ubuntu 20.0* LTS에 Nginx를 mainline으로 설치하고 싶다면, 자세히 설명해 주신 이 분의 글을 참고하도록 하자

반응형

'IT & IOT 이야기 > 어쩌다개발' 카테고리의 다른 글

Convert MOV to MP4  (0) 2024.02.06
[Python]Add watermark text to the image  (0) 2024.01.25
[Streamlit] link html file  (0) 2024.01.25
avahi-daemon 이란?  (0) 2024.01.25
댓글
최근에 올라온 글
최근에 달린 댓글
글 보관함
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Total
Today
Yesterday