全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1264|回复: 3

[美国VPS] 请教反代GPT

[复制链接]
发表于 2023-5-27 18:19:52 | 显示全部楼层 |阅读模式
本帖最后由 泡泡的碎片 于 2023-5-27 18:20 编辑

我打算反代GPT,既 https://chat.openai.com

配置文件如下
  1. server {
  2.     listen 80;
  3.     listen 443 ssl;
  4.     ssl_certificate /usr/local/nginx/conf/ssl/反代域名_ecc/fullchain.cer;
  5.     ssl_certificate_key /usr/local/nginx/conf/ssl/反代域名_ecc/反代域名.key;
  6.     ssl_session_cache shared:SSL:10m;
  7.     ssl_session_timeout 10m;
  8.     server_name 反代域名;
  9.     add_header Strict-Transport-Security "max-age=31536000";

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

  13.     location / {
  14.         # 设置 User-Agent
  15.         if ($http_user_agent ~* (bot|crawler)) {
  16.             set $user_agent "Bot";
  17.         }
  18.         if ($http_user_agent ~* (google|bing|yahoo)) {
  19.             set $user_agent "Search Engine";
  20.         }
  21.         if ($http_user_agent ~* (mobile|tablet)) {
  22.             set $user_agent "Mobile Device";
  23.         }
  24.         if ($http_user_agent ~* (msie|trident)) {
  25.             set $user_agent "Internet Explorer";
  26.         }
  27.         if ($http_user_agent ~* (firefox)) {
  28.             set $user_agent "Firefox";
  29.         }
  30.         if ($http_user_agent ~* (chrome)) {
  31.             set $user_agent "Chrome";
  32.         }
  33.         if ($http_user_agent ~* (safari)) {
  34.             set $user_agent "Safari";
  35.         }
  36.         proxy_set_header User-Agent $user_agent;

  37.         # 其他代理设置
  38.         proxy_set_header Host chat.openai.com;
  39.         proxy_set_header X-Real-IP $remote_addr;
  40.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  41.         proxy_set_header Referer https://chat.openai.com;
  42.         proxy_pass https://chat.openai.com;
  43.         proxy_set_header Accept-Encoding "";
  44.         proxy_set_header Host $host;
  45.         proxy_set_header X-Real-IP $remote_addr;
  46.         proxy_set_header Authorization "";  # 绕过 HTTP Basic 身份验证
  47.         proxy_ssl_server_name on;
  48.         proxy_ssl_name chat.openai.com;
  49.     }
  50. }
复制代码



访问反代域名,报错“This web property is not accessible via this address./无法通过此地址访问此网络资产。”


请问大佬如何修改配置文件,实现反代GPT
发表于 2023-5-27 18:21:18 | 显示全部楼层
chat.openai.com套了CF, 你要想办法过掉CF啊
发表于 2023-5-27 18:24:26 来自手机 | 显示全部楼层
这是套了cf,简单的反代并不能绕过cf waf的限制,你看我今天发的贴,跟你的问题差不多
发表于 2023-5-27 18:43:59 来自手机 | 显示全部楼层
很难的啦,直接用api
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-26 12:04 , Processed in 0.056702 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表