- Next.js 16 App Router + TypeScript + Tailwind CSS 4 - Prisma/SQLite 기반 공지사항·자료실·관리자·문의/제보 - 네이버 블로그 RSS 최신 글 5개 노출 - OCI 운영 배포 스크립트 및 문서
89 lines
2.8 KiB
Plaintext
89 lines
2.8 KiB
Plaintext
# saftyovhcable.kr — Next.js(yonggong) 리버스 프록시
|
|
# 레거시 정적 자산(/addMarker.html, /res/, /blogload.js)은 /var/www/html 에서 계속 서비스합니다.
|
|
# /etc/nginx/sites-available/saftyovhcable.kr
|
|
# 한글 도메인(용공협.kr)은 퓨니코드로 같은 server 블록에서 함께 처리합니다.
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name saftyovhcable.kr xn--ob0bs83a9mfulcsua52c2xubym.xn--3e0b707e;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://saftyovhcable.kr$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name saftyovhcable.kr xn--ob0bs83a9mfulcsua52c2xubym.xn--3e0b707e;
|
|
|
|
root /var/www/html;
|
|
index index.html;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/saftyovhcable.kr/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/saftyovhcable.kr/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
client_max_body_size 60m;
|
|
client_body_timeout 120s;
|
|
|
|
# HTTPS 전용 (인증서 자동 갱신 검증 완료)
|
|
add_header Strict-Transport-Security "max-age=31536000" always;
|
|
|
|
# --- 레거시 지도/정적 자산 ---
|
|
location = /addMarker.html {
|
|
try_files $uri =404;
|
|
}
|
|
location ^~ /res/ {
|
|
try_files $uri =404;
|
|
expires 7d;
|
|
access_log off;
|
|
}
|
|
location = /blogload.js {
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
# 짧은 주소 / 옛 정적 페이지
|
|
location = /index.html { return 301 /; }
|
|
location = /index.htm { return 301 /; }
|
|
location = /news { return 301 /news/notice; }
|
|
location = /board { return 301 /news/notice; }
|
|
|
|
# --- Next.js 정적 자산 (캐시 헤더는 앱이 직접 설정) ---
|
|
location /_next/static/ {
|
|
proxy_pass http://yonggong_app;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
access_log off;
|
|
}
|
|
|
|
# --- 애플리케이션 ---
|
|
location / {
|
|
proxy_pass http://yonggong_app;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "";
|
|
proxy_read_timeout 120s;
|
|
proxy_send_timeout 120s;
|
|
}
|
|
}
|