lobehub/lobe-chat

[Bug] 用Nginx 进行反代,出现初始化失败问题 #1859

vank3f3 posted onGitHub

💻 系统环境

Ubuntu

📦 部署环境

Docker

🌐 浏览器

Edge

🐛 问题描述

使用的是“lobehub/lobe-chat:latest” 20210402最新打包的docker image 在docker部署好之后,用IP+端口能正常访问,但是用Nginx进行反代的时候,首页初始化失败。 其中,Nginx配置如下

server {
    listen 80;
    server_name  abc.com;

    location ^~ / {
        proxy_pass http://10.0.254.104;
        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 REMOTE-HOST $remote_addr; 
        proxy_set_header Upgrade $http_upgrade; 
        proxy_set_header Connection "upgrade"; 
        proxy_http_version 1.1; 
        add_header Cache-Control no-cache; 
        proxy_cache off;  
        proxy_buffering off;  
        chunked_transfer_encoding on;  
        tcp_nopush on;  
        tcp_nodelay on;  
        keepalive_timeout 300;  
    }

}

出现的问题主要如下图 image image

🚦 期望结果

能满足用Nginx 对 lobe-chat 进行反向代理

📷 复现步骤

No response

📝 补充信息

No response


👀 @vank3f3

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

posted by lobehubbot 12 months ago

看到 A Error with Permissions-Policy header: Origin trial controlled feature not enabled: 一类的报错, 在浏览器里是否给了对应的权限? @vank3f3

posted by luojiyin1987 11 months ago

看到 A Error with Permissions-Policy header: Origin trial controlled feature not enabled: 一类的报错, 在浏览器里是否给了对应的权限? @vank3f3

请教一下,需要进行哪些权限呢,部署了lobechat后,直接使用IP是可以正常使用的呀,但是加上了Nginx的反向代理后就会出现上图lobe-chat的初始化失败

posted by vank3f3 11 months ago

我习惯配置

proxy_pass http://10.0.254.104/;

Nginx 有什么报错日志?

posted by luojiyin1987 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I'm used to configuring

proxy_pass http://10.0.254.104;

What error logs does Nginx have?

posted by lobehubbot 11 months ago

我习惯配置

proxy_pass http://10.0.254.104/;

Nginx 有什么报错日志?

你好,经验证是Nginx中的proxy_buffering off; 这行所影响,注释后可以正常初始化了

posted by vank3f3 11 months ago

@vank3f3 麻烦关闭 issue

posted by luojiyin1987 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@vank3f3 Please close the issue

posted by lobehubbot 11 months ago

✅ @vank3f3

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

posted by lobehubbot 11 months ago

Fund this Issue

$0.00
Funded

Pull requests