Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
7ed3c91a
authored
Apr 26, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: nginx proxy
parent
1f801d14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
docs/nginxProxy.md
+72
-0
No files found.
docs/nginxProxy.md
0 → 100644
View file @
7ed3c91a
# nginx 反向代理 openai 接口
```
conf
user
nginx
;
worker_processes
auto
;
worker_rlimit_nofile
51200
;
events
{
worker_connections
1024
;
}
http
{
resolver
8
.
8
.
8
.
8
;
proxy_ssl_server_name
on
;
access_log
off
;
server_names_hash_bucket_size
512
;
client_header_buffer_size
32
k
;
large_client_header_buffers
4
32
k
;
client_max_body_size
50
M
;
gzip
on
;
gzip_min_length
1
k
;
gzip_buffers
4
8
k
;
gzip_http_version
1
.
1
;
gzip_comp_level
6
;
gzip_vary
on
;
gzip_types
text
/
plain
application
/
x
-
javascript
text
/
css
application
/
javascript
application
/
json
application
/
xml
;
gzip_disable
"MSIE [1-6]\."
;
open_file_cache
max
=
1000
inactive
=
1
d
;
open_file_cache_valid
30
s
;
open_file_cache_min_uses
8
;
open_file_cache_errors
off
;
server
{
listen
443
ssl
;
server_name
your_host
;
ssl_certificate
/
ssl
/
your_host
.
pem
;
ssl_certificate_key
/
ssl
/
your_host
.
key
;
ssl_session_timeout
5
m
;
location
~ /
openai
/(.*) {
# auth check
if
($
http_authkey
!=
"xxxxxx"
) {
return
403
;
}
proxy_pass
https
://
api
.
openai
.
com
/$
1
$
is_args
$
args
;
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
;
# 流式响应
proxy_set_header
Connection
''
;
proxy_http_version
1
.
1
;
chunked_transfer_encoding
off
;
proxy_buffering
off
;
proxy_cache
off
;
# 一般响应
proxy_buffer_size
128
k
;
proxy_buffers
4
256
k
;
proxy_busy_buffers_size
256
k
;
}
}
server
{
listen
80
;
server_name
ai
.
fastgpt
.
run
;
rewrite
^(.*)
https
://$
server_name
$
1
permanent
;
}
}
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment