4b86b2a660
- server-dev start/stop/deploy 및 Gitea push 자동 배포 - local-dev 로컬 개발 환경 Co-authored-by: Cursor <cursoragent@cursor.com>
345 lines
9.5 KiB
Nginx Configuration File
345 lines
9.5 KiB
Nginx Configuration File
|
|
#user nobody;
|
|
worker_processes auto;
|
|
|
|
#error_log logs/error.log;
|
|
#error_log logs/error.log notice;
|
|
#error_log logs/error.log info;
|
|
|
|
#pid logs/nginx.pid;
|
|
|
|
|
|
events {
|
|
worker_connections 2048;
|
|
}
|
|
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
server_tokens off;
|
|
|
|
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
# '$status $body_bytes_sent "$http_referer" '
|
|
# '"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
#access_log logs/access.log main;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
#keepalive_timeout 0;
|
|
keepalive_timeout 65;
|
|
|
|
gzip on;
|
|
gzip_static on;
|
|
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
gzip_proxied any;
|
|
gzip_vary on;
|
|
gzip_comp_level 6;
|
|
gzip_buffers 16 8k;
|
|
gzip_http_version 1.1;
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name chatbot.ex.co.kr;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
|
|
server_name chatbot.ex.co.kr;
|
|
|
|
ssl_certificate /home/song/exWebChat/chained.ex.co.kr.pem;
|
|
ssl_certificate_key /home/song/exWebChat/prv_ast.ex.co.kr.key;
|
|
ssl_dhparam /home/song/letsencrypt/dhparam.pem;
|
|
ssl_protocols TLSv1.2;
|
|
|
|
location / {
|
|
#root html;
|
|
#index index.html;
|
|
add_header 'Access-Control-Allow-Origin' 'https://www.extoll.co.kr';
|
|
proxy_pass http://localhost:8080;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
# =========================================================================
|
|
# chatbotApp 정적 UI
|
|
# URL: https://chatbot.ex.co.kr/chatbot/app/
|
|
# 파일 위치: /home/song/chatbotApp/public/
|
|
# =========================================================================
|
|
|
|
location = /chatbot/app {
|
|
return 301 /chatbot/app/;
|
|
}
|
|
|
|
location = /chatbot/app/ {
|
|
alias /home/song/chatbotApp/public/;
|
|
index index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location = /chatbot/app/index.html {
|
|
alias /home/song/chatbotApp/public/index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location ^~ /chatbot/app/_next/ {
|
|
alias /home/song/chatbotApp/public/_next/;
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
}
|
|
|
|
location ^~ /chatbot/app/ {
|
|
alias /home/song/chatbotApp/public/;
|
|
try_files $uri =404;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
|
|
# =========================================================================
|
|
# chatbotApp AI UI
|
|
# URL: https://chatbot.ex.co.kr/chatbot/ai/
|
|
# 파일 위치: /home/song/chatbotApp/public-ai/
|
|
# =========================================================================
|
|
|
|
location = /chatbot/ai {
|
|
return 301 /chatbot/ai/;
|
|
}
|
|
|
|
location = /chatbot/ai/ {
|
|
alias /home/song/chatbotApp/public-ai/;
|
|
index index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location = /chatbot/ai/index.html {
|
|
alias /home/song/chatbotApp/public-ai/index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location ^~ /chatbot/ai/_next/ {
|
|
alias /home/song/chatbotApp/public-ai/_next/;
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
}
|
|
|
|
location ^~ /chatbot/ai/ {
|
|
alias /home/song/chatbotApp/public-ai/;
|
|
try_files $uri =404;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
|
|
# =========================================================================
|
|
# chatbotApp → Skill 웹 채팅 API
|
|
# chatbotApp 기본 API root: /chatbot
|
|
# /chatbot/ask → Skill /web/ask
|
|
# /chatbot/ask/stream → Skill /web/ask/stream
|
|
# /chatbot/openapi.json → Skill /web/openapi.json
|
|
# =========================================================================
|
|
|
|
location = /chatbot/ask {
|
|
proxy_pass http://localhost:8083/web/ask;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 120s;
|
|
proxy_send_timeout 120s;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location = /chatbot/ask/stream {
|
|
proxy_pass http://localhost:8083/web/ask/stream;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
# SSE 설정
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 120s;
|
|
proxy_send_timeout 120s;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
gzip off;
|
|
add_header X-Accel-Buffering no;
|
|
}
|
|
|
|
location = /chatbot/openapi.json {
|
|
proxy_pass http://localhost:8083/web/openapi.json;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 30s;
|
|
proxy_send_timeout 30s;
|
|
}
|
|
|
|
|
|
# =========================================================================
|
|
# chatbotApp FAQ / Session / Health → RAG API
|
|
# FAQ 버튼, 세션 추적, 헬스체크용
|
|
# RAG: 172.16.180.130:28012
|
|
# =========================================================================
|
|
|
|
location ^~ /chatbot/faq/ {
|
|
proxy_pass http://172.16.180.130:28012/chatbot/faq/;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location ^~ /chatbot/session/ {
|
|
proxy_pass http://172.16.180.130:28012/chatbot/session/;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location = /chatbot/health {
|
|
proxy_pass http://172.16.180.130:28012/chatbot/health;
|
|
proxy_http_version 1.1;
|
|
|
|
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 Host $http_host;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 30s;
|
|
proxy_send_timeout 30s;
|
|
}
|
|
|
|
|
|
location /kakao {
|
|
#root html;
|
|
#index index.html;
|
|
proxy_pass http://localhost:8081;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
location /oakak {
|
|
#root html;
|
|
#index index.html;
|
|
proxy_pass http://localhost:8082;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
location /extoll {
|
|
#root html;
|
|
#index index.html;
|
|
proxy_pass http://localhost:8084;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
location /test/ {
|
|
#root html;
|
|
#index index.html;
|
|
proxy_pass http://localhost:8083/oakak/;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
|
|
location /images {
|
|
alias /usr/local/nginx/data/images;
|
|
}
|
|
|
|
location /fonts {
|
|
alias /usr/local/nginx/data/fonts;
|
|
}
|
|
|
|
location /card {
|
|
alias /usr/local/nginx/data/card;
|
|
}
|
|
|
|
#location /.well-known {
|
|
# root html/well-known;
|
|
#}
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
#
|
|
error_page 404 500 502 503 504 /error.html;
|
|
location /error.html {
|
|
root /usr/local/nginx/html/errors/;
|
|
internal;
|
|
}
|
|
|
|
}
|
|
# another virtual host using mix of IP-, name-, and port-based configuration
|
|
#
|
|
#server {
|
|
# listen 8000;
|
|
# listen somename:8080;
|
|
# server_name somename alias another.alias;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
|
|
# HTTPS server
|
|
#
|
|
#server {
|
|
# listen 443 ssl;
|
|
# server_name localhost;
|
|
|
|
# ssl_certificate cert.pem;
|
|
# ssl_certificate_key cert.key;
|
|
|
|
# ssl_session_cache shared:SSL:1m;
|
|
# ssl_session_timeout 5m;
|
|
|
|
# ssl_ciphers HIGH:!aNULL:!MD5;
|
|
# ssl_prefer_server_ciphers on;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
}
|