adams549659584 / go-proxy-bingai

用 Vue3 和 Go 搭建的微软 New Bing 演示站点,拥有一致的 UI 体验,支持 ChatGPT 提示词,国内可用。
MIT License
8.86k stars 13.22k forks source link

本站不可用 #335

Open kalvinses opened 1 year ago

kalvinses commented 1 year ago

我用的宝塔做的反代,本来最开始用的是nginx,按照之前翻到的错误里面,添加了
location /sydney/ChatHub { proxy_pass http://172.17.0.1:8787; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; }

location / {
    proxy_pass http://172.17.0.1:8787;
    proxy_set_header Host              $host;    
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host  $host;
    proxy_set_header X-Forwarded-Port  $server_port;
} 

问题还是没有解决,后面试了一下npm,但是npm不知道为什么,经常出现400错误,反代有问题,最后改的用宝塔面板做的ssl证书和反代。

PROXY-START/

location ^~ / { proxy_pass http://172.17.0.1:8787; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port;

add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache

if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
    expires 1m;
}
proxy_ignore_headers Set-Cookie Cache-Control expires;
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 1m;

}

PROXY-END/

这个是宝塔面板里面的反代设置,问题依旧,能访问,但是本站服务器不可用,折腾好几天了,求大佬解救

ccodingfundddd commented 1 year ago

使用caddy,3行代码就搞定了。
Debian系统Caddy安装: sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update sudo apt install caddy 编辑配置文件 /etc/caddy/Caddyfile baidu.com encode gzip reverse_proxy 127.0.0.1:8080 然后执行:systemctl restart caddy

kalvinses commented 1 year ago

使用caddy,3行代码就搞定了。 Debian系统Caddy安装: sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update sudo apt install caddy 编辑配置文件 /etc/caddy/Caddyfile baidu.com encode gzip reverse_proxy 127.0.0.1:8080 然后执行:systemctl restart caddy

可我是centos8,甲骨文的arm机,很多服务都在上面,暂时没打算换系统。。。

ccodingfundddd commented 1 year ago

centos8 网上查下怎么装cadyy也行,至于会不会跟nginx冲突,我不太清楚了。