6bed393c12
Backend Tests / backend-unit-test (push) Has been cancelled
Backend Tests / benchmark-test (push) Has been cancelled
CI@main / Node.js v22 (ubuntu-latest) (push) Has been cancelled
Thrift Syntax Validation / validate-thrift (push) Has been cancelled
License Check / License Check (push) Has been cancelled
65 lines
2.2 KiB
Plaintext
65 lines
2.2 KiB
Plaintext
# 1. HTTP 80端口跳转HTTPS
|
|
server {
|
|
listen 80;
|
|
server_name testcoze.kejiankejian.com coze-testcoze.kejiankejian.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
# 2. HTTPS 443端口(主站)
|
|
server {
|
|
listen 443 ssl;
|
|
server_name testcoze.kejiankejian.com coze-testcoze.kejiankejian.com;
|
|
client_max_body_size 100M;
|
|
|
|
# SSL配置
|
|
ssl_certificate /etc/nginx/ssl/_.kejiankejian.com_chain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/_.kejiankejian.com_key.key;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256;
|
|
|
|
# 前端静态资源
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
try_files $uri $uri/ /index.html;
|
|
index index.html index.htm;
|
|
add_header Cache-Control "public, max-age=3600" always;
|
|
}
|
|
|
|
# API代理
|
|
location ~ ^/(api|v[1-3]|admin)(/|$) {
|
|
proxy_pass http://coze-server:8888;
|
|
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_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 600s;
|
|
sub_filter ':8889' ':8888/local_storage';
|
|
sub_filter 'minio:9000' '$http_host/local_storage';
|
|
sub_filter_once off;
|
|
sub_filter_types 'application/json' 'text/event-stream';
|
|
}
|
|
|
|
# MinIO文件访问代理
|
|
location /local_storage/ {
|
|
rewrite ^/local_storage/(.*)$ /$1 break;
|
|
proxy_pass http://coze-minio:9000;
|
|
proxy_set_header Host coze-minio:9000;
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 600s;
|
|
add_header Access-Control-Allow-Origin "*" always;
|
|
add_header Access-Control-Allow-Credentials "true" always;
|
|
add_header Access-Control-Allow-Methods "*" always;
|
|
add_header Access-Control-Allow-Headers "*" always;
|
|
if ($request_method = 'OPTIONS') {
|
|
return 204;
|
|
}
|
|
}
|
|
}
|
|
|