tomcat 서버 8000번 포트와 nginx 80 번 포트를 연결 할려 했더니
cors , 403 error 가 떴다.
이는 cors , 권한? 문제인데 이를 nginx proxy를 활용해서 해결했다..
앞서 nginx 설정을 해놓고
https://tinylittlelife.tistory.com/294
/etc/nginx/nginx.conf 를
# /etc/nginx/nginx.conf
http {
# 기존 설정들...
upstream App1 {
server ip:port;
}
server {
listen 80;
server_name ip; # IP 주소나 도메인으로 변경
location / {
root /home/ubuntu/nginx/build;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
rewrite /api/(.*) /$1 break;
proxy_pass http://App1;
}
}
# 기존 설정들...
}
위와 같은 설정으로 설정했더니 해결 됬다!!!
TIP.
site-available , site-enable 을 위와 같이 변경했지만
upstream 문제로 인해 설정이 불가능 했다. 잘하는 사람들은 하겠지..
참조 자료
'Linux' 카테고리의 다른 글
tomcat - 환경변수 설정, Springboot 에 적용 (0) | 2023.12.28 |
---|---|
ubuntu - github 접속 (1) | 2023.12.27 |
Linux - vim , vi 설치 (1) | 2023.12.23 |