Skip to content

Commit

Permalink
disable keepalive by default
Browse files Browse the repository at this point in the history
No need for keepalive for the internal socket.
  • Loading branch information
thestinger committed Mar 20, 2024
1 parent 15318ca commit 5054d71
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ http {
sendfile_max_chunk 256k;
tcp_nopush on;
keepalive_requests 256;
keepalive_timeout 3m;
keepalive_timeout 0;
server_tokens off;
msie_padding off;

Expand Down Expand Up @@ -97,8 +97,6 @@ http {
listen 80 default_server backlog=4096;
listen [::]:80 default_server backlog=4096;

keepalive_timeout 0;

# https://trac.nginx.org/nginx/ticket/2012
location / {
return 404;
Expand All @@ -110,8 +108,6 @@ http {
listen [::]:80;
server_name matrix.grapheneos.org element.grapheneos.org;

keepalive_timeout 0;

location /.well-known/acme-challenge/ {
root /srv/certbot;
}
Expand All @@ -126,8 +122,6 @@ http {
listen [::]:443 default_server ssl http2 backlog=4096;
ssl_reject_handshake on;

keepalive_timeout 0;

# https://trac.nginx.org/nginx/ticket/2012
location / {
return 404;
Expand All @@ -139,6 +133,8 @@ http {
listen [::]:443 ssl http2;
server_name matrix.grapheneos.org;

keepalive_timeout 3m;

include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "font-src 'none'; manifest-src 'none'; object-src 'none'; script-src 'none'; style-src 'none'; frame-ancestors 'none'" always;
Expand Down Expand Up @@ -184,6 +180,8 @@ http {

include root_element.grapheneos.org.conf;

keepalive_timeout 3m;

include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "cross-origin" always;
add_header Content-Security-Policy "font-src 'self'; manifest-src 'self'; object-src 'none'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self'" always;
Expand Down

0 comments on commit 5054d71

Please sign in to comment.