diff --git a/docker/default.conf b/docker/default.conf index a6e87f1a..c16fdcdc 100644 --- a/docker/default.conf +++ b/docker/default.conf @@ -2,25 +2,28 @@ server { listen 80 default_server; server_name _; - #charset koi8-r; - #access_log /var/log/nginx/host.access.log main; - - # 跳转到伊利GPT - location /yiligpt { - return 302 https://yiligpt.x.digitalyili.com/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share; - } - location / { root /var/www/html; index index.html index.htm; - try_files $uri $uri/ //index.html; + try_files $uri $uri/ /index.html; } + # 反向代理配置:将 /yiligpt 映射到外部链接 + location /yiligpt { + proxy_pass https://yiligpt.x.digitalyili.com/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share ; + 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; - # redirect server error pages to the static page /50x.html + # 如果目标服务器使用 HTTPS,需要以下设置 + proxy_ssl_server_name on; + proxy_ssl_verify on; + } + + # 错误页面 error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/html; } - -} +} \ No newline at end of file