Skip to content

Commit

Permalink
Update 2023-04-18-nginx.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhengwei authored Nov 13, 2024
1 parent 17e9909 commit 2caf45f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/md/devops/2023-04-18-nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,18 @@ docker run \

![](https://bugstack.cn/images/article/devops/dev-ops-nginx-230418-04.png)

## 五、OpenAI 访问
## 五、重定向

### 1. 重定向
### 1. default.conf

在 default.conf 中添加如下配置后重启 Nginx 即可;

```shell
location /d5fe/ {
rewrite ^/d5fe/(.*)$ /$1 break;
proxy_pass https://api.openai.com;
proxy_pass https://api.x.com;
proxy_ssl_server_name on;
proxy_set_header Host api.openai.com;
proxy_set_header Host api.x.com;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
Expand Down Expand Up @@ -351,9 +351,9 @@ server {
location /abc/ {
auth_request /auth;
rewrite ^/abc/(.*)$ /$1 break;
proxy_pass https://api.openai.com;
proxy_pass https://api.x.com;
proxy_ssl_server_name on;
proxy_set_header Host api.openai.com;
proxy_set_header Host api.x.com;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
Expand Down

0 comments on commit 2caf45f

Please sign in to comment.