Recently, some netizens asked Pagoda how to set up a reverse proxy. The editor here introduces a simple operation method, which is to use the reverse proxy function that comes with Pagoda's official software panel. First of all, you need to install the pagoda panel. After the Nginx or LNMP environment configuration is complete, you can start to set up the reverse proxy. Let's see the operation steps below.
This method is the simplest and quickest, has no complicated steps, and is not prone to errors. It is the simplest method with zero code and zero deployment.
Implementation preparation
- a server
- Install Pagoda Panel
- OpenAI official API_KEY
- ChatGPT website system source code
ChatGPT website system source code , you can take a look at another article introduction:
"The latest ChatGPT website source code + support for ai painting + Prompt role + real-time voice recognition input"
Pagoda recommends installing the official version, open source and free
Linux installation command:
yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec
start
1. Step 1:
Use the pagoda panel to create a new site - bind your own domain name - select pure static - confirm and submit!
2. The second step:
Deploy the SSL certificate of the domain name.
I won’t introduce too much here.
3. The third step:
add configuration reverse proxy
The target address is filled with Openai’s official API address: https://api.openai.com, and the sending domain name is also: api.openai.com, which is usually obtained automatically.
4. The fourth step:
check verification
You can see that my reverse proxy is already the same as the official one.
use:
Go to the website system or use a local deployment project for use!
In this way, we have implemented the ChatGPT website system to realize the domestic server access to the openai official website interface.
Other possible problems and solutions:
If there is a 502 Bad Gateway problem after the anti-generation ChatGPT API interface :
The main reason is the reason for the SSL certificate. When SSL is turned on, it does not match during the three-way handshake, causing the handshake to fail!
Solution:
Open the site - reverse proxy - configuration file - add two lines of code - save
Code added:
1:
proxy_ssl_server_name on;
2:
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
Perfect solution:
Test results:
The tutorial is over!