Tomcat + Nginx 연동하기

프로그래밍/리눅스 2018. 6. 28. 17:48 Posted by 상콩이

리눅스 커멘트 창에서


vi /etc/nginx/nginx.conf


a 를 입력하여 글쓰기 모드로 변환 후


location에 아래와 같이 적어줍니다


proxy_pass http://localhost:8080;
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;






그 후에 톰캣과 nginx를 재실행 시켜줍니다.


service tomcat restart

service nginx restart