From 21f1cc9cfac7d0f83f0bc7aff9c74ca239e7bff7 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:19:37 +0900 Subject: [PATCH] nginx middleware server --- src/Home/Net/Programs/Skynet/HowToHost.txt | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/Home/Net/Programs/Skynet/HowToHost.txt diff --git a/src/Home/Net/Programs/Skynet/HowToHost.txt b/src/Home/Net/Programs/Skynet/HowToHost.txt new file mode 100644 index 00000000..527741e0 --- /dev/null +++ b/src/Home/Net/Programs/Skynet/HowToHost.txt @@ -0,0 +1,51 @@ +// This is an NGINX reverse proxy configuration file for the Skynet Middleware + +server { + // set whatever port you'd like + listen 9000; + // replace the server name with yours + server_name skynet.middleware.com; + + # Custom log locations + access_log /var/log/nginx/skynet_access.log; + error_log /var/log/nginx/skynet_error.log; + + location /gpt3 { + proxy_pass https://api.openai.com/v1/completions; # GPT-3 endpoint + + # Required for SSL verification with the upstream server (OpenAI) + proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + proxy_ssl_session_reuse off; + + # Headers for OpenAI + // replace the sk-XXXX with your API key + proxy_set_header Authorization "Bearer sk-XXXX"; + proxy_set_header Content-Type "application/json"; + + # Standard proxy headers + proxy_set_header Host api.openai.com; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /chat { + proxy_pass https://api.openai.com/v1/chat/completions; # ChatGPT endpoint + + # Required for SSL verification with the upstream server (OpenAI) + proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + proxy_ssl_session_reuse off; + + # Headers for OpenAI + // replace the sk-XXXX with your API key + proxy_set_header Authorization "Bearer sk-XXXX"; + proxy_set_header Content-Type "application/json"; + + # Standard proxy headers + proxy_set_header Host api.openai.com; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + +} \ No newline at end of file