# ============================================================ # Kong AI Gateway - 对外 API # 域名: api.kejiankejian.com # ============================================================ # HTTP -> HTTPS server { listen 80; listen [::]:80; server_name api.kejiankejian.com; return 301 https://$host$request_uri; } # HTTPS server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.kejiankejian.com; client_max_body_size 50m; client_body_buffer_size 10m; 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_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256; ssl_prefer_server_ciphers off; add_header Strict-Transport-Security "max-age=63072000" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; access_log /dev/stdout; error_log /dev/stderr; location / { proxy_pass http://kong_proxy; 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 Connection ""; # SSE / 流式响应 proxy_buffering off; proxy_cache off; proxy_read_timeout 300s; proxy_send_timeout 300s; } }