File tree 2 files changed +23
-6
lines changed
2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 21
21
allow_credentials = True ,
22
22
allow_methods = ["GET" , "POST" ],
23
23
allow_headers = ["*" ],
24
+ expose_headers = ["Content-Type" , "Content-Disposition" ],
24
25
)
25
26
26
27
API_ANALYTICS_KEY = os .getenv ("API_ANALYTICS_KEY" )
Original file line number Diff line number Diff line change @@ -15,6 +15,28 @@ server {
15
15
proxy_pass http://127.0.0.1:8000;
16
16
include proxy_params;
17
17
proxy_redirect off;
18
+
19
+ # Add these new settings
20
+ proxy_buffering off;
21
+ proxy_http_version 1.1;
22
+ proxy_set_header Connection '';
23
+ proxy_set_header X-Real-IP $remote_addr;
24
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25
+ proxy_set_header Host $host;
26
+
27
+ # Increase timeouts
28
+ proxy_connect_timeout 300;
29
+ proxy_send_timeout 300;
30
+ proxy_read_timeout 300;
31
+ send_timeout 300;
32
+
33
+ # Add error handling
34
+ proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
35
+ proxy_next_upstream_tries 2;
36
+
37
+ # Keep connection alive
38
+ keepalive_timeout 300;
39
+ keepalive_requests 100;
18
40
}
19
41
20
42
# Return 444 for everything else (no response, just close connection)
@@ -23,12 +45,6 @@ server {
23
45
# keep access log on
24
46
}
25
47
26
- # Add timeout settings
27
- proxy_connect_timeout 300;
28
- proxy_send_timeout 300;
29
- proxy_read_timeout 300;
30
- send_timeout 300;
31
-
32
48
listen 443 ssl; # managed by Certbot
33
49
ssl_certificate /etc/letsencrypt/live/api.gitdiagram.com/fullchain.pem; # managed by Certbot
34
50
ssl_certificate_key /etc/letsencrypt/live/api.gitdiagram.com/privkey.pem; # managed by Certbot
You can’t perform that action at this time.
0 commit comments