Skip to content

Commit d562c59

Browse files
cursoragentlovasoa
andcommitted
Refactor NGINX proxy settings documentation for clarity
Co-authored-by: contact <[email protected]>
1 parent b8b370c commit d562c59

File tree

1 file changed

+4
-4
lines changed
  • examples/official-site/your-first-sql-website

1 file changed

+4
-4
lines changed

examples/official-site/your-first-sql-website/nginx.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ server {
5252
}
5353
```
5454

55-
### Streaming and compression
55+
### Streaming-friendly proxy settings
5656

57-
SQLPage streams HTML as it is generated, so browsers start rendering before the database finishes returning rows. Preserve that behaviour in NGINX by keeping buffering minimal and letting the proxy handle compression:
57+
SQLPage streams HTML by default so the browser can render results while the database is still sending rows. To preserve this low-latency behaviour through NGINX, add the following directives inside the same `location` block as `proxy_pass`:
5858

5959
```nginx
6060
proxy_buffering off;
@@ -66,9 +66,9 @@ SQLPage streams HTML as it is generated, so browsers start rendering before the
6666
chunked_transfer_encoding on;
6767
```
6868

69-
Turning off buffering lowers latency but increases how many concurrent connections reach SQLPage; only raise the buffers if you need to smooth bursty traffic. Adjust the gzip buffers for your CPU versus bandwidth trade-off, and toggle chunked transfer to keep streaming with HTTP/1.1 clients. See the official guidance for [proxy buffering](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering), [gzip](https://nginx.org/en/docs/http/ngx_http_gzip_module.html), and [chunked transfer](https://nginx.org/en/docs/http/ngx_http_core_module.html#chunked_transfer_encoding).
69+
Disabling buffering lets responses reach clients immediately but increases how many simultaneous connections SQLPage must serve; raise the buffers only if you prefer smoothing bursts over fastest-first rendering. Tune the gzip buffer count and size to balance CPU cost and bandwidth, and keep chunked transfer enabled so streaming works with HTTP/1.1 clients. Consult the official NGINX documentation for [proxy buffering](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering), [gzip](https://nginx.org/en/docs/http/ngx_http_gzip_module.html), and [chunked transfer](https://nginx.org/en/docs/http/ngx_http_core_module.html#chunked_transfer_encoding) when adjusting these values. If you later implement heavy caching (see the section below), you may choose to reintroduce buffering for specific locations.
7070

71-
When SQLPage runs behind a reverse proxy, set `compress_responses` to `false` so NGINX can compress once at the edge (documented [here](https://github.com/sqlpage/SQLPage/blob/main/configuration.md)).
71+
When SQLPage sits behind a reverse proxy, set `compress_responses` to `false` in `sqlpage.json` so that NGINX compresses once at the edge (documented [here](https://github.com/sqlpage/SQLPage/blob/main/configuration.md)).
7272

7373
Save the file and create a symbolic link to it in the `/etc/nginx/sites-enabled/` directory:
7474
```bash

0 commit comments

Comments
 (0)