Skip to content

Commit 3e71305

Browse files
committed
Enable connection pooling in nginx upstreams
1 parent 70ef4cd commit 3e71305

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

deployments/modules/backend/app.nginx.conf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ server {
66

77
upstream web.luajit.me {
88
server 127.0.0.1:8000;
9+
keepalive 1000;
910
}
1011

1112
upstream compute.luajit.me {
1213
least_conn;
1314
# <COMPUTE_AMD64_IPV4_ADDRESS>
1415
server 127.0.0.1 down; # workaround for "no servers configured"
16+
keepalive 1000;
1517
}
1618

1719
proxy_cache_path /data/nginx/cache levels=1 keys_zone=luajit.me:1m;
@@ -26,10 +28,16 @@ server {
2628
application/wasm
2729
application/json;
2830
gzip_min_length 800;
29-
location / { proxy_pass http://web.luajit.me; }
31+
location / {
32+
proxy_pass http://web.luajit.me;
33+
proxy_http_version 1.1;
34+
proxy_set_header Connection "";
35+
}
3036
location /run {
3137
proxy_pass http://compute.luajit.me;
3238
proxy_next_upstream non_idempotent;
39+
proxy_http_version 1.1;
40+
proxy_set_header Connection "";
3341
}
3442
location /static {
3543
proxy_pass http://web.luajit.me;

0 commit comments

Comments
 (0)