docs: add nginx gzip configuration for JSON compression
Activity index shards compress ~90% with gzip (130 KB → 14 KB). The default nginx.conf has gzip on but gzip_types commented out, so JSON was served uncompressed.
This commit is contained in:
@@ -293,6 +293,26 @@ ln -s /etc/nginx/sites-available/bincio /etc/nginx/sites-enabled/
|
|||||||
nginx -t && systemctl reload nginx
|
nginx -t && systemctl reload nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Enable gzip compression
|
||||||
|
|
||||||
|
The default `nginx.conf` has gzip on but `gzip_types` commented out, so only
|
||||||
|
HTML is compressed. Activity index shards are JSON and compress ~90% — enable
|
||||||
|
the full list:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# In /etc/nginx/nginx.conf, uncomment the gzip block:
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_buffers 16 8k;
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nginx -t && systemctl reload nginx
|
||||||
|
```
|
||||||
|
|
||||||
You can verify the site is served correctly by hitting the IP directly:
|
You can verify the site is served correctly by hitting the IP directly:
|
||||||
`http://<your-vps-ip>/` — you should see the bincio activity feed, not the nginx welcome page.
|
`http://<your-vps-ip>/` — you should see the bincio activity feed, not the nginx welcome page.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user