티스토리 뷰

0. 준비 및 기본정보

 

* 세팅상태  : https://deve1oper.tistory.com/4 포스팅참고

 

1. 준비

      - NginX 설치하기

      - AWS EC2

      sudo amazon-linux-extras install -y nginx1
       -> Amazon linux 기반이기 때문에 amazon-linux-extras 패키지를 지원해준다.

 

2. NginX 실행하기
      - sudo service nginx start

 

2-1. NginX 기동 확인
      - ps -ef | grep nginx

3. NginX URL 포트번호없애기 

 

3-1. root 로그인
      - sudo su -


3-2. nginx.conf 수정하기

     - 경로 : etc/nginx/nginx.conf

     - vi nginx.conf

     - 해당 내용 추가
server {
:
:

location / {
proxy_pass http://localhost:9090;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}

:
:
}

 

 - 해당 스프링부트 설정된 포트로 수정하여 저장한다.

 - 작성자는 9090포트 사용 중

 

 

3-3.  NginX 재시작

 - (sudo) service nginx restart

 

4. 접속방법

http://주소/

 


참고링크 : https://jojoldu.tistory.com/267?category=635883