기술 스택 및 버전 EC2 세팅

Nginx & Letsencrypt 설치 Docker 설치

redis 설치 MySQL 환경 셋팅 root 계정 패스워드 변경 대소문자 구분 해결하기 백엔드 빌드 배포용 설정 jar 파일로 빌드 도커 파일로 빌드 ( 프론트엔드 / 백엔드 ) 백엔드 배포

젠킨스 내부 작업

외부 서비스 문서

베이스 덤프파일 최신본

시연 시나리오

기술 스택 및 버전

프로젝트기술스택

EC2 세팅

Nginx & Letsencrypt 설치

sudo apt-get update
sudo apt-get install nginx
sudo nginx -v
sudo systemctl stop nginx

# SSL 인증
sudo apt-get install letsencrypt
sudo letsencrypt certonly --stadalone -d i8a806.p.ssafy.io
cd /etc/letsencrypt/live/i8a806.p.ssafy.io # root 계정으로..
cd /etx/nginx/sites-available 
sudo vim nginx.conf

server{
    location / {
            proxy_pass <http://localhost:3000>;

            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header Origin "";

    }

    location /api {
            #rewrite ^/api(.*)$ $1?$args break;
            proxy_pass <http://localhost:8080>;
    }

    location /ws {
            proxy_pass <http://localhost:8080>;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header Origin "";1
    }

   location /api/ws-stomp {
            proxy_pass <http://localhost:8080>;
            #rewrite /api/(.*) /$1 break;

            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
    }

listen 443 ssl; # managed by Certbot
# 도메인 이름을 써줘야함
ssl_certificate /etc/letsencrypt/live/i8a806.p.ssafy.io/fullchain.pem; # managed by Certbot
# 도메인 이름을 써줘야함
ssl_certificate_key /etc/letsencrypt/live/i8a806.p.ssafy.io/privkey.pem; # managed by Certbot
# include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {

# 도메인 이름을 입력
if ($host = i8a806.p.ssafy.io) {
    return 301 https://$host$request_uri;
} # managed by Certbot

    client_max_body_size 10M;
}

# 파일 연동 및 테스트
sudo ln -s /etc/nginx/sites-available/nginx.conf/etc/nginx/sites-enabled/nginx.conf
sudo nginx -t

# Nginx 재시작
sudo systemctl restart nginx

#Nginx 상태 확인
sudo systemctl status nginx