Nginx performance tweaks

This commit is contained in:
2026-02-28 12:25:31 -06:00
parent fdba0fdf8c
commit b4becea001

View File

@@ -2,8 +2,37 @@ server {
listen 80; listen 80;
server_name localhost; server_name localhost;
absolute_redirect off; absolute_redirect off;
# copies data between one FD and other from within the kernel
# faster than read() + write()
sendfile on;
# send headers in one piece, it is better than sending them one by one
tcp_nopush on;
# don't buffer data sent, good for small data bursts in real time
tcp_nodelay on;
gzip on;
gzip_types
# text/html is always compressed by HttpGzipModule
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/atom+xml
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;
location / { location / {
gzip_static on;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
} }