https 접속허용
This commit is contained in:
+18
-27
@@ -604,42 +604,33 @@ docker system prune -f
|
||||
|
||||
## HTTPS (HTTP + HTTPS 동시 접속)
|
||||
|
||||
기본은 **HTTP(80)만** 동작합니다. `docker/nginx/ssl/` 에 인증서가 있으면 frontend 컨테이너가 **HTTPS(443)** 도 함께 엽니다. HTTP→HTTPS 강제 리다이렉트는 하지 않습니다.
|
||||
### exdev.co.kr (운영 — Caddy + gc-frontend)
|
||||
|
||||
### 최초 1회 (exdev.co.kr 서버)
|
||||
이 서버는 **443 포트를 ex-chatbot Caddy**가 사용합니다. GoldenChart HTTPS는 Caddy → `host.docker.internal:80` → **gc-frontend** 경로입니다.
|
||||
|
||||
| URL | 경로 |
|
||||
|-----|------|
|
||||
| `http://exdev.co.kr/` | gc-frontend `:80` 직접 |
|
||||
| `https://exdev.co.kr/` | Caddy `:443` (TLS) → gc-frontend `:80` |
|
||||
|
||||
**주의:** `docker-compose.yml` 에 frontend `443:443` 매핑을 넣으면 Caddy 와 충돌해 **frontend 가 기동되지 않습니다** (HTTP·HTTPS 모두 502). frontend 는 **80만** 노출합니다.
|
||||
|
||||
```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
|
||||
# frontend 기동 확인
|
||||
docker ps --filter name=gc-frontend
|
||||
curl -s -o /dev/null -w "HTTP:%{http_code}\n" http://exdev.co.kr/
|
||||
curl -sk -o /dev/null -w "HTTPS:%{http_code}\n" https://exdev.co.kr/
|
||||
```
|
||||
|
||||
### 검증
|
||||
Caddy TLS 인증서: `exAIChatbot2.0/docker/nginx/certs/` (`obtain-cert-exdev.sh`)
|
||||
|
||||
### 단독 서버 (Caddy 없음, nginx 가 직접 TLS)
|
||||
|
||||
```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/
|
||||
docker compose -f docker-compose.yml -f docker-compose.https.yml up -d frontend
|
||||
./scripts/setup-exdev-https.sh --email you@example.com --domain example.com
|
||||
```
|
||||
|
||||
### 인증서 갱신 (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. 트러블슈팅
|
||||
|
||||
Reference in New Issue
Block a user