Files
AriWeb-Suite/modules/webmaker/deploy/nginx-webhosting.conf
T

57 lines
5.1 KiB
Plaintext
Raw Normal View History

# AI 웹호스팅 에이전트 — nginx 사이트 설정
# / -> 생성 UI (Node 서버, 127.0.0.1:3080)
# /<32자리 16진 ID>/... -> /var/www/sites/<ID>/... 정적 서비스
# 미등록 호스트 요청은 안내 페이지(404)로만 응답 — 어떤 서비스도 노출되지 않음
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
server_tokens off;
location / { default_type text/html; return 404 '<!doctype html><html lang="ko"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>페이지를 찾을 수 없습니다</title><style>body{margin:0;min-height:100vh;display:grid;place-items:center;font-family:-apple-system,"Segoe UI","Noto Sans KR",sans-serif;background:#f4f5f7;color:#1f2933}main{text-align:center;padding:32px}h1{font-size:22px;margin:0 0 8px}p{color:#6b7684;margin:0}</style></head><body><main><h1>페이지를 찾을 수 없습니다</h1><p>요청하신 페이지가 존재하지 않거나 이동되었습니다.</p></main></body></html>'; }
}
server {
listen 80;
listen [::]:80;
server_name 192.168.20.66 localhost 127.0.0.1;
client_max_body_size 200m;
# 오류 페이지: 서버 종류·버전이나 다른 서비스의 내용이 드러나지 않도록 일반 안내로 대체
server_tokens off;
error_page 404 /__wh_404;
error_page 403 =404 /__wh_404;
error_page 500 502 503 504 /__wh_50x;
location = /__wh_404 { internal; default_type text/html; return 404 '<!doctype html><html lang="ko"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>페이지를 찾을 수 없습니다</title><style>body{margin:0;min-height:100vh;display:grid;place-items:center;font-family:-apple-system,"Segoe UI","Noto Sans KR",sans-serif;background:#f4f5f7;color:#1f2933}main{text-align:center;padding:32px}h1{font-size:22px;margin:0 0 8px}p{color:#6b7684;margin:0}</style></head><body><main><h1>페이지를 찾을 수 없습니다</h1><p>요청하신 페이지가 존재하지 않거나 이동되었습니다.</p></main></body></html>'; }
location = /__wh_50x { internal; default_type text/html; return 503 '<!doctype html><html lang="ko"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>일시적인 오류가 발생했습니다</title><style>body{margin:0;min-height:100vh;display:grid;place-items:center;font-family:-apple-system,"Segoe UI","Noto Sans KR",sans-serif;background:#f4f5f7;color:#1f2933}main{text-align:center;padding:32px}h1{font-size:22px;margin:0 0 8px}p{color:#6b7684;margin:0}</style></head><body><main><h1>일시적인 오류가 발생했습니다</h1><p>잠시 후 다시 시도해 주세요.</p></main></body></html>'; }
# 사용자 생성 사이트: http://192.168.20.66/<32hex>/ (index.html) 또는 /<32hex>/page.html
# 발행 취소된 사이트: 작업 폴더에 .unpublished 표식이 있으면 내용 대신 "사이트 수정 중" 안내 (v1.1.4)
location = /__wh_maint { internal; default_type text/html; add_header Cache-Control "no-store"; return 503 '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="noindex"><title>Updating</title><style>body{margin:0;min-height:100vh;display:grid;place-items:center;font-family:-apple-system,"Segoe UI","Noto Sans KR","Noto Sans JP","Noto Sans SC",sans-serif;background:#f4f5f7;color:#1f2933}main{text-align:center;padding:32px 24px;max-width:640px}h1{font-size:28px;line-height:1.3;margin:0 0 18px}p{color:#4b5563;margin:6px 0;line-height:1.6;font-size:15px}.f{margin-top:26px;font-size:12px;color:#9aa3af}</style></head><body><main><h1>We&#39;re updating our site. Please check back soon.</h1><p lang="ko">사이트 개정 작업 중입니다. 잠시 후에 다시 접속해주세요.</p><p lang="ja">サイトの改訂作業中です。しばらくしてから再度アクセスしてください。</p><p lang="zh">网站正在改版中,请稍后再访问。</p><p lang="es">El sitio está en proceso de revisión. Vuelva a intentarlo en unos minutos.</p><p class="f">Webmaker is working .... supported by ibit.kr</p></main></body></html>'; }
location ~ "^/([a-f0-9]{32})(/|$)" {
root /var/www/sites;
index index.html;
if (-f $document_root/$1/.unpublished) { rewrite ^ /__wh_maint last; }
try_files $uri $uri/ =404;
add_header Cache-Control "no-cache";
# 접속 통계 (lib/stats.js 가 5분마다 읽음; 형식은 conf.d/wmstats.conf)
access_log /var/log/nginx/webmaker-sites.log wmstats;
location ~ /\. { return 404; }
}
# 생성 UI / API (SSE 지원을 위해 버퍼링 해제)
location / {
proxy_pass http://127.0.0.1:3080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_intercept_errors off;
}
}