想改一下 webui 的标题信息,用这位佬的方法试了 免修改不影响更新!自定义 OpenWebUI 图标与删除网站名中的 (Open WebUI) json 里面返回的修改没问题,title 还是原来的,琢磨着把 title 的也修改了。下面是配置
location / {
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;
# WebSocket 支持
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 禁用后端压缩,确保替换生效
proxy_set_header Accept-Encoding "";
# 避免乱码
charset utf-8;
add_header Content-Type "text/html; charset=utf-8";
sub_filter_types text/html application/json; # 允许修改 HTML 和 JSON 类型,这里用 * 也可以,性能差点
sub_filter_once off;
sub_filter '<title>Open WebUI</title>' '<title > 你的网站名</title>';
sub_filter '"name":"Open WebUI"' '"name":"你的网站名"';
proxy_pass http://127.0.0.1:8080;
index index.html index.htm;
}
如果出现title乱码,看一下你的nginx conf 是不是UTF-8,如果不是就需要转成UTF-8
慢的话可以试着强制压缩下openwebui的js,在我这边效果还可以,在nginx 的 http 块下面增加以下配置
gzip on; # 开启 Gzip
gzip_disable "msie6"; # 不对 IE6 及更早版本启用压缩(可选,根据实际情况)
gzip_min_length 1000; # 最小压缩文件大小(字节),小于此大小不压缩
gzip_proxied any; # 对所有代理请求启用压缩(包括来自后端服务的响应)
gzip_comp_level 8; # 压缩级别(1-9,数字越大压缩率越高,CPU 消耗也越大)
gzip_types text/plain text/css application/json application/javascript text/xml
application/xml application/xml+rss text/javascript; # 要压缩的 MIME 类型
2025-03-06 更新加上替换logo等图标
在nginx中增加
#代理logo
location ~ ^/static/(favicon|logo|splash)\.png$ {
alias E:/software/nginx-1.27.1/html/webui/图标.png; #指向你的图标路径
#alias E:/software/nginx-1.27.1/html/webui/$1.png; #如果需要分开代理则使用这个,在目录下需要放对应的图片
}
#代理favicon
location ~ ^/favicon/ {
alias E:/software/nginx-1.27.1/html/webui/图标.png; #把favicon下的图片统一指向logo.png
location ~ \.svg$ {
types { } default_type image/svg+xml;
}
location ~ \.ico$ {
types { } default_type image/x-icon;
}
default_type image/png;
}




