V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  testcase  ›  全部回复第 1 页 / 共 1 页
回复总数  2
作为用过 27 2k 和 27 4k 的用户,解决方案只有换成 4k ,2k 看着字体发虚。
2023-08-04 17:51:20 +08:00
回复了 zengdamo2018 创建的主题 分享创造 分享一个 Claude 2 镜像站
假设 ip 192.168.1.201 能连外网

1. 生成自签证书(其他证书也可以)
openssl genrsa -out test.com.key 2048
openssl req -new -subj "/C=US/ST=BeiJing/L=BJ/O=test/OU=test.com/CN=test.com" -key test.com.key -out test.com.csr
mv test.com.key test.com.origin.key
openssl rsa -in test.com.origin.key -out test.com.key
openssl x509 -req -days 3650 -in test.com.csr -signkey test.com.key -out test.com.crt

2. 配置 nginx
server
{
listen 80;
listen 443 ssl;
ssl on;
ssl_certificate /root/software/test.com.crt;
ssl_certificate_key /root/software/test.com.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server_name httech.com;
add_header Strict-Transport-Security "max-age=31536000";

if ( $scheme = http ){
return 301 https://$server_name$request_uri;
}

if ($http_user_agent ~* (baiduspider|360spider|haosouspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) {
return 403;
}

location / {
sub_filter claude.ai 192.168.1.201;
sub_filter_once off;
proxy_ssl_server_name on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer https://claude.ai;
proxy_set_header Host claude.ai;
proxy_pass https://claude.ai;
proxy_set_header Accept-Encoding "";
}
}

3. 重启 nginx ,访问 https://192.168.1.201
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2846 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 07:17 · PVG 15:17 · LAX 23:17 · JFK 02:17
Developed with CodeLauncher
♥ Do have faith in what you're doing.