From c600c509bee459977c313922e7bd1ca06b1a02e4 Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Sun, 17 Dec 2023 14:36:22 +0800 Subject: [PATCH] Add chatgpt proxy. --- Server/conf/nginx.conf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Server/conf/nginx.conf b/Server/conf/nginx.conf index 2940d8e..9bbdca7 100644 --- a/Server/conf/nginx.conf +++ b/Server/conf/nginx.conf @@ -62,6 +62,10 @@ http { server 127.0.0.1:8086; } + upstream frp_chatgpt { + server 127.0.0.1:8087; + } + init_by_lua_file lua/settings.lua; server { @@ -115,6 +119,33 @@ http { } } + server { + listen 443 ssl; + server_name chatgpt.amass.fun; + + client_header_timeout 120s; + client_body_timeout 120s; + + ssl_certificate cert/chatgpt.amass.fun.pem; + ssl_certificate_key cert/chatgpt.amass.fun.key; + ssl_session_timeout 5m; #缓存有效期 + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法 + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议 + ssl_prefer_server_ciphers on; #使用服务器端的首选算法 + + location / { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-wiz-real-ip $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://frp_chatgpt; + } + } + server { listen 443 ssl; server_name pve.amass.fun;