Skip to content

Commit ea611c7

Browse files
committed
nginx: enable TCP Fast Open for HTTP(S)
This isn't used by end user machines in practice due to privacy and compatibility reasons but it works well between servers. We're using it for authoritative DNS per the RFC 9210 recommendation and might as well have it available for HTTP and HTTPS since it does get used a bit in practice. The queue size determines how many pending fast open connections which have not yet completed the handshake are allowed before the kernel will fall back to waiting for the handshake. TCP Fast Open key rotation and persistence has been handled as part of our baseline server configuration.
1 parent a217652 commit ea611c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nginx/nginx.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ http {
105105
}
106106

107107
server {
108-
listen 80 default_server backlog=4096 rcvbuf=2048 sndbuf=2048;
109-
listen [::]:80 default_server backlog=4096 rcvbuf=2048 sndbuf=2048;
108+
listen 80 default_server backlog=4096 fastopen=4 rcvbuf=2048 sndbuf=2048;
109+
listen [::]:80 default_server backlog=4096 fastopen=4 rcvbuf=2048 sndbuf=2048;
110110

111111
# https://trac.nginx.org/nginx/ticket/2012
112112
location / {
@@ -129,8 +129,8 @@ http {
129129
}
130130

131131
server {
132-
listen 443 default_server ssl backlog=4096;
133-
listen [::]:443 default_server ssl backlog=4096;
132+
listen 443 default_server ssl backlog=4096 fastopen=16;
133+
listen [::]:443 default_server ssl backlog=4096 fastopen=16;
134134
http2 on;
135135
ssl_reject_handshake on;
136136

0 commit comments

Comments
 (0)