mirror of
https://github.com/hwanny1128/HGZero.git
synced 2025-12-06 11:26:25 +00:00
53 lines
1.3 KiB
Nginx Configuration File
53 lines
1.3 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index 01-로그인.html;
|
|
|
|
# 한글 파일명 지원
|
|
charset utf-8;
|
|
|
|
# 로그 설정
|
|
access_log /var/log/nginx/access.log;
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
# 루트 경로를 명시적으로 로그인 페이지로 처리
|
|
# 디렉토리처럼 처리하여 index 지시어가 작동하도록 함
|
|
location = / {
|
|
try_files $uri/ /01-로그인.html;
|
|
}
|
|
|
|
# 모든 다른 요청에 대해 기본 처리
|
|
location / {
|
|
try_files $uri $uri/ /01-로그인.html;
|
|
}
|
|
|
|
# index.html 요청도 로그인 페이지로
|
|
location = /index.html {
|
|
return 301 /01-로그인.html;
|
|
}
|
|
|
|
# 정적 파일 캐싱
|
|
location ~* \.(html|css|js|png|jpg|jpeg|gif|ico|svg)$ {
|
|
expires 1d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# 헬스체크 엔드포인트
|
|
location /health {
|
|
access_log off;
|
|
return 200 "OK\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
|
|
# 404 처리
|
|
error_page 404 /01-로그인.html;
|
|
|
|
# gzip 압축
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss;
|
|
}
|