CentOs7에 nginx 설치 + tomcat 연동하기



#yum list 명령어후에 nginx 가 없다면 레파지토리 업데이트 한다!!

레파지토리 업데이트 명령어

#yum install epel-release

업데이트가 된후에

#yum install nginx 


서비스 시작

# service nginx start

서비스 종료

# service nginx stop


설치 기본 경로

/etc/nginx/


기본 설정 파일은 

/etc/nginx/conf.d/defaulf.conf 


vi /etc/nginx/conf.d/defaulf.conf 


server{} 안에 


#포트설정

listen       80 ;

#도메인설정    

server_name  localhost;


#웹루트

root   /usr/share/nginx/html


#tomcat 연동

     upstream backend {

        server  localhost:8080

     }

     location ~ \.jsp$ {

               proxy_pass      http://localhost:8080;

     }


저장하고 나오면 설정 끝!

http:localhost:80/index.html 실행시 페이지 나오면 nginx 설치 성공

웹루트에 index.jsp 를 만들고 

http:localhost:80/index.jsp  시 페이지 나오면 톰캣 연동 성공!




Posted by 양승아
: