go-proxy-bingai
go-proxy-bingai copied to clipboard
本站不可用
我用的宝塔做的反代,本来最开始用的是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/ 这个是宝塔面板里面的反代设置,问题依旧,能访问,但是本站服务器不可用,折腾好几天了,求大佬解救
使用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
使用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机,很多服务都在上面,暂时没打算换系统。。。
centos8 网上查下怎么装cadyy也行,至于会不会跟nginx冲突,我不太清楚了。