22 include /etc/nginx/mime.types;
33 include /etc/nginx/log.conf;
44
5- server_tokens off;
6- sendfile on;
7- tcp_nopush on;
5+ aio threads;
6+ aio_write on;
7+
8+ tcp_nopush on;
9+ tcp_nodelay on;
810
9- client_max_body_size 500m;
10- client_body_buffer_size 128k;
11- client_body_timeout 300s;
12- client_header_timeout 605s;
13- keepalive_timeout 605s;
14- proxy_connect_timeout 60s;
15- proxy_read_timeout 600s;
16- proxy_send_timeout 60s;
17- send_timeout 60s;
11+ client_body_timeout 60s;
12+ client_header_timeout 60s;
13+ keepalive_timeout 75s;
14+ proxy_connect_timeout 5s;
15+ proxy_read_timeout 60s;
16+ proxy_send_timeout 60s;
17+ send_timeout 60s;
18+
19+ reset_timedout_connection on;
20+
21+ port_in_redirect off;
22+ server_tokens off;
1823
1924 # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
2025 # scheme used to connect to this server
@@ -44,9 +49,19 @@ http {
4449 '' $request_id;
4550 }
4651
52+ # See https://www.nginx.com/blog/websocket-nginx
53+ map $http_upgrade $proxy_connection {
54+ default Upgrade;
55+ '' '';
56+ }
57+
4758 proxy_http_version 1.1;
48- proxy_set_header Connection "";
4959 proxy_set_header Host $host;
60+ proxy_set_header Connection $proxy_connection;
61+ proxy_set_header Upgrade $http_upgrade;
62+
63+ # Mitigate httpoxy vulnerability
64+ proxy_set_header Proxy "";
5065
5166 proxy_set_header X-Real-IP $remote_addr;
5267 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -59,11 +74,13 @@ http {
5974 include /etc/nginx/app.conf;
6075
6176 server {
62- listen 18081 default_server;
77+ listen 18081 default_server;
78+
79+ access_log off;
80+ keepalive_timeout 0;
6381
64- location /healthz {
65- access_log off;
66- return 200;
67- }
82+ location /healthz {
83+ return 200;
84+ }
6885 }
6986}
0 commit comments