mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 08:46:38 +08:00
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'websocket' upgrade;
|
|
}
|
|
server {
|
|
# listen 443 ssl;
|
|
listen 8080;
|
|
# server_name www.chatgpt.com; #替换成你自己的域名
|
|
|
|
# ssl_certificate xxx.pem; # 替换成自己的 SSL 证书
|
|
# ssl_certificate_key xxx.key;
|
|
# ssl_session_timeout 5m;
|
|
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
|
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
# ssl_prefer_server_ciphers on;
|
|
|
|
# 日志地址
|
|
access_log /var/log/access.log;
|
|
error_log /var/log/error.log;
|
|
|
|
index index.html;
|
|
root /var/www/app/dist; # 这里改成前端静态页面的地址
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
# 后端 API 的转发
|
|
location /api/ {
|
|
proxy_http_version 1.1;
|
|
proxy_connect_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 12s;
|
|
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 Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_pass http://geekai-api:5678;
|
|
}
|
|
|
|
# 静态资源转发
|
|
location /static/ {
|
|
proxy_pass http://geekai-api:5678;
|
|
}
|
|
}
|
|
}
|