본문 바로가기
node.js & nginx

React + IIS + Node.js

by 프갭 2023. 8. 7.

프론트 React 와 백앤드 Node.js(Reverse Proxy) 를 IIS 배포 하는 과정 입니다.

 

 

1. React 빌드

build폴더 내용 복사 하여 서버로 복사 합니다.

 npm run build

 

 

 

2. IIS 구성

Turn Windows Features on or off 클릭 => IIS 설치(node 에서 소켓을 사용할 경우 WebSocket Protocol 설치)

 

IIS 설정

 

site 명(IIS 항목에 표시되는 이름) 입력 후 Physical path 경로 설정(1항목에서 복사한 폴더)

Host Name 도메인 명 입력 (도메인 없을경우 아이피로 접근해야한다)

 

3.Node.js (Reverse Proxy)

1. 서브 응용 프로그램 생성

Alias명 입력후 임의의 폴더 설정(해당 폴더에 Web.config 파일 생성되면 Web.config Reverse Proxy 셋팅 정보가 저장된다)

Alias 명은 이후 https://***.****.***/{Alias명}으로 Node js의 경로가 된다.

 

2. 설치 파일 다운로드후 설치

URL Rewrite ,Application request routing 설치

https://www.iis.net/downloads/microsoft/url-rewrite

 

URL Rewrite : The Official Microsoft IIS Site

Overview IIS URL Rewrite 2.1 enables Web administrators to create powerful rules to implement URLs that are easier for users to remember and easier for search engines to find. By using rule templates, rewrite maps, .NET providers, and other functionality i

www.iis.net

https://www.iis.net/downloads/microsoft/application-request-routing

 

Application Request Routing : The Official Microsoft IIS Site

Overview IIS Application Request Routing (ARR) 3 enables Web server administrators, hosting providers, and Content Delivery Networks (CDNs) to increase Web application scalability and reliability through rule-based routing, client and host name affinity, l

www.iis.net

3.Enable Proxy Setting

Application Request Routing Click => Server Proxy Settings Click => Enable proxy 체크

 

 

4.Reverse Proxy Setting

3-1 항목에 만들었던 서브 응용프로그램 클릭 => Url Rewrite => pm2로 구동된 node.js 서비스 Url 입력(localhost:9000)

 

 

반응형

'node.js & nginx' 카테고리의 다른 글

7. Nginx 로드밸런싱  (0) 2023.05.19
6. Node.js Worker Thread  (0) 2023.05.19
5. Nginx reverse proxy 설정  (0) 2023.05.18
4. 배포 및 pm2 서비스 등록  (0) 2023.05.17
3. Node.js 설치 방법 3가지  (0) 2023.05.17

댓글