📡 API 문서
외부에서 API 호출 시 X-API-Key: dclub-api-key-2025-secure 헤더 필요
🌐 DNS 관리 API
| 메서드 |
엔드포인트 |
설명 |
| GET |
/api/list |
DNS 레코드 목록 |
| POST |
/api/create |
서브도메인 생성 |
| POST |
/api/delete |
DNS 레코드 삭제 |
# 서브도메인 생성
curl -X POST https://api.dclub.kr/api/create \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{"subdomain":"myapp","server":"253"}'
# DNS 목록 조회
curl -H "X-API-Key: dclub-api-key-2025-secure" https://api.dclub.kr/api/list
🔧 Nginx 관리 API
| 메서드 |
엔드포인트 |
설명 |
| GET |
/api/nginx/sites |
Nginx 사이트 목록 |
| POST |
/api/nginx/create |
Nginx 사이트 생성 |
| POST |
/api/nginx/add-location |
location 블록 추가 (/api 등) |
| DELETE |
/api/nginx/delete/:domain |
Nginx 사이트 삭제 |
# Nginx 사이트 생성 (253서버 35000포트로 프록시)
curl -X POST https://api.dclub.kr/api/nginx/create \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{"domain":"myapp.dclub.kr","target":"192.168.45.253","port":35000}'
# /api 경로 추가
curl -X POST https://api.dclub.kr/api/nginx/add-location \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{"domain":"myapp.dclub.kr","location":"/api","target":"192.168.45.253","port":35001}'
🔒 SSL 인증서 API
| 메서드 |
엔드포인트 |
설명 |
| GET |
/api/ssl/status/:domain |
SSL 상태 확인 |
| POST |
/api/ssl/apply |
와일드카드 SSL 적용 |
# SSL 적용 (*.dclub.kr 와일드카드 자동 적용)
curl -X POST https://api.dclub.kr/api/ssl/apply \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{"domain":"myapp.dclub.kr"}'
🔌 포트 관리 API
| 메서드 |
엔드포인트 |
설명 |
| GET |
/api/port/list |
전체 포트 목록 |
| GET |
/api/port/next?server=253&range=web |
다음 사용 가능 포트 |
| POST |
/api/port/reserve |
포트 예약 |
| DELETE |
/api/port/release/:server/:port |
포트 해제 |
| GET |
/api/port/find?project=xxx |
프로젝트로 포트 검색 |
# 다음 웹 포트 조회
curl -H "X-API-Key: dclub-api-key-2025-secure" \
"https://api.dclub.kr/api/port/next?server=253&range=web"
# 포트 예약
curl -X POST https://api.dclub.kr/api/port/reserve \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{"server":"253","port":30005,"project":"myapp","desc":"내 앱"}'
# 포트 해제
curl -X DELETE -H "X-API-Key: dclub-api-key-2025-secure" \
https://api.dclub.kr/api/port/release/253/30005
📊 포트 범위 규칙
web
30000-39999 (웹 앱)
api
40000-49999 (API 서버)
system
50000-59999 (시스템)
chatbot
53000-53999 (챗봇)
🚀 원클릭 배포 API (★ 추천)
POST /api/deploy
한번의 API 호출로 포트예약 + DNS + Nginx + SSL 전체 자동 설정!
| 파라미터 |
필수 |
설명 |
| subdomain |
필수 |
서브도메인 (예: myapp) |
| port |
필수 |
메인 포트 번호 |
| project |
필수 |
프로젝트명 |
| server |
선택 |
서버 (기본: 253) |
| desc |
선택 |
설명 |
| apiPort |
선택 |
API 서버 포트 (있으면 /api 경로 추가) |
| apiLocation |
선택 |
API 경로 (기본: /api) |
# ⭐ 원클릭 배포 (웹만)
curl -X POST https://api.dclub.kr/api/deploy \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{
"subdomain": "myapp",
"port": 35000,
"project": "myapp",
"desc": "내 앱"
}'
# ⭐ 원클릭 배포 (웹 + API)
curl -X POST https://api.dclub.kr/api/deploy \
-H "X-API-Key: dclub-api-key-2025-secure" \
-H "Content-Type: application/json" \
-d '{
"subdomain": "myapp",
"port": 35000,
"project": "myapp",
"desc": "내 앱",
"apiPort": 35001,
"apiLocation": "/api"
}'
# 응답 예시
{
"success": true,
"domain": "myapp.dclub.kr",
"url": "https://myapp.dclub.kr",
"message": "배포 완료!",
"steps": [
{"step": "포트예약", "status": "ok", "port": 35000},
{"step": "API포트예약", "status": "ok", "port": 35001},
{"step": "DNS등록", "status": "ok", "record": "myapp.dclub.kr → 192.168.45.253"},
{"step": "Nginx설정", "status": "ok"},
{"step": "SSL적용", "status": "ok", "type": "wildcard"}
]
}