https 접속 허용

This commit is contained in:
Macbook
2026-06-15 13:02:41 +09:00
parent 6481a432fd
commit 8922895ab7
13 changed files with 306 additions and 151 deletions
+41 -1
View File
@@ -90,7 +90,7 @@ GoldenChart 배포는 **공통 스크립트 `deploy.sh`** 를 중심으로 두
| 서비스 | 컨테이너 | 포트 (기본) | URL |
|--------|---------|------------|-----|
| Frontend (Nginx) | `gc-frontend` | 80 | http://exdev.co.kr/ |
| Frontend (Nginx) | `gc-frontend` | 80, **443** | http://exdev.co.kr/ · https://exdev.co.kr/ |
| Backend (Spring Boot) | `gc-backend` | 8080 | http://exdev.co.kr:8080 (직접) 또는 `/api` (Nginx 경유) |
| MySQL | `gc-mysql` | 3306 | localhost:3306 (서버 내부) |
@@ -602,6 +602,46 @@ docker system prune -f
---
## HTTPS (HTTP + HTTPS 동시 접속)
기본은 **HTTP(80)만** 동작합니다. `docker/nginx/ssl/` 에 인증서가 있으면 frontend 컨테이너가 **HTTPS(443)** 도 함께 엽니다. HTTP→HTTPS 강제 리다이렉트는 하지 않습니다.
### 최초 1회 (exdev.co.kr 서버)
```bash
cd /Users/aidev/dev/goldenChart # work-tree 경로
# 1) frontend 가 80에서 동작 중인지 확인
docker compose up -d frontend
# 2) Let's Encrypt 발급 (도메인이 이 서버를 가리켜야 함, 443 방화벽 개방)
./scripts/setup-exdev-https.sh --email you@example.com --domain exdev.co.kr
# 테스트용 자체 서명 (브라우저 경고 발생)
# ./scripts/setup-exdev-https.sh --self-signed
```
### 검증
```bash
curl -s -o /dev/null -w "HTTP: %{http_code}\n" http://exdev.co.kr/
curl -s -o /dev/null -w "HTTPS: %{http_code}\n" https://exdev.co.kr/
```
### 인증서 갱신 (cron 예시, 매월)
```bash
docker run --rm \
-v "$(pwd)/docker/nginx/certbot-webroot:/var/www/certbot" \
-v "$(pwd)/docker/nginx/letsencrypt:/etc/letsencrypt" \
certbot/certbot renew
docker compose exec frontend nginx -s reload
```
> **Mac 방화벽:** 시스템 설정 → 네트워크 → 방화벽에서 **443/tcp** 허용. 공유기/클라우드에서도 443 포워딩이 필요할 수 있습니다.
---
## 12. 트러블슈팅
### 12-1. git push 후 배포가 안 됨