返回提交历史
Modified
docs/reverse-proxy.md
+16
-3
XFEstudio/gpt4free
Fix nginx rate limiting configuration in documentation
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
7fb733c8
代码差异
1 个文件
+16
-3
@@ -543,6 +543,21 @@ Note: Binding to `127.0.0.1:8080` ensures the service is only accessible locally
543
543
544
544
### 2. Configure Nginx with HTTPS
545
545
546
First, add the rate limit zone to your main nginx configuration `/etc/nginx/nginx.conf` in the `http` block:
547
548
```nginx
549
http {
550
# ... other http settings ...
551
552
# Rate limiting zone
553
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
554
555
# ... rest of http block ...
556
}
557
```
558
559
Then create the site configuration `/etc/nginx/sites-available/gpt4free`:
560
546
561
```nginx
547
562
# /etc/nginx/sites-available/gpt4free
548
563
server {
@@ -565,10 +580,8 @@ server {
565
580
add_header X-Content-Type-Options "nosniff" always;
566
581
add_header X-Frame-Options "DENY" always;
567
582
568
# Rate limiting
569
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
570
571
583
location / {
584
# Apply rate limiting
572
585
limit_req zone=api_limit burst=20 nodelay;
573
586
574
587
proxy_pass http://127.0.0.1:8080;