Before you start, you need to understand these concepts#
- Domain names purchased from domain name providers within mainland China require real-name authentication to enable DNS resolution. However, domain names purchased from foreign domain name providers do not require this.
- Websites that point to cloud servers within mainland China must be filed for record before they can be accessed normally. However, any domain name that points to a foreign server is not subject to this rule. You can take advantage of this to bypass the restriction.
- Vercel is a platform that allows you to deploy modern web applications quickly without the need for a cloud server.
- vercel.app itself is a blocked website, but its server IP is not blocked. You can take advantage of this to directly point your domain name to the Vercel server and access the services provided by Vercel.
- This article uses Yidadaa/ChatGPT-Next-Web to build the ChatGPT web service.
Prerequisites#
- OpenAI API Key
- A domain name
- Magic (required to access Vercel)
Detailed Steps#
-
Fork the Yidadaa/chatgpt-vercel project to your GitHub.
-
Create a new project in Vercel and select the project you just forked. Click the Import button.
-
Add environment variables in the Environment Variables section, then click the Deploy button.
For personal use, adding
OPENAI_API_KEY
andCODE
is sufficient.CODE
can have multiple passwords, separated by commas. The123456,789012
in the image represents that123456
and789012
are both passwords.If you want to learn more about the environment variables in this project, please refer to the official environment variable documentation of ChatGPT-Next-Web.
Please note: The API Key shown in the image is not complete and has been processed, so it cannot be used directly.
-
Now, your project has been successfully deployed. Try accessing it and see if it works.
-
Remember to fill in your authorization code in Settings -> Authorization Code with the passwords you set in the
CODE
environment variable, otherwise it will not work.Here, I ask ChatGPT to recommend gradient colors for me in a specific format (HTML code). Rendering HTML code with Typora can greatly improve the readability and intuitiveness of the content.
-
Bind your domain name. Click Settings -> Domains, enter the domain name you want to bind, and then click the Add button.
Here, we use test.nekoko.top as an example.
-
Add Vercel's CNAME or A record to your domain name's DNS resolution (either one is fine).
Here, we use Cloudflare as an example. Open the website dash.cloudflare.com and add DNS records.
-
DNS -> Records -> Add Record. Add a CNAME record as follows and save it.
cname-china.vercel-dns.com
-
-
Open your bound domain name in a browser. Here, we use test.nekoko.top as an example.
Please note that if the browser address bar shows Not Secure, wait a few minutes before accessing it again because Vercel is generating an SSL certificate and the browser cannot use HTTPS connection at this time.
In the Vercel project's Settings -> Domains, the successfully bound domain name should be similar to the image below.
-
When you cannot ensure that your visitors will use your service properly and reasonably, please be careful not to share your website casually unless you trust them enough. Any suspicious activity may result in your domain name being blocked.