@cryptotaxi247 / kubo / commits / 406d70ff7

doc: document reverse proxy bug

see https://github.com/ipfs/go-ipfs/issues/6402

Steven Allen committed Jun 15, 2020 at 17:01 UTC 406d70ff7cfe9eb4e1fd2dc3a5f35be6d37a3ccd
1 file changed +6 -33
docs/production/reverse-proxy.md
+6 -33
@@ -12,11 +12,16 @@ reverse HTTP proxy (usually NGINX). You may need a reverse proxy to:
12 * Block content.
13 * Rate limit and timeout requests.
14 * Apply QoS rules (e.g., prioritize traffic for certain important IPFS resources).
15 -* Expose a limited subset of the HTTP API.
15
16 This document contains a collection of tips, tricks, and pitfalls when running a
17 go-ipfs node behind a reverse HTTP proxy.
18
19 +**WARNING:** Due to
20 +[nginx#1293](https://trac.nginx.org/nginx/ticket/1293)/[go-ipfs#6402](https://github.com/ipfs/go-ipfs/issues/6402),
21 +parts of the go-ipfs API will not work correctly behind an NGINX reverse proxy
22 +as go-ipfs starts sending back a response before it finishes reading the request
23 +body. The gateway itself is unaffected.
24 +
25 ## Peering
26
27 Go-ipfs gateways behind a single load balancing reverse proxy should use the
@@ -45,38 +50,6 @@ you run out of space, instead of garbage collecting.
50 This will effectively "garbage collect" without actually running the garbage
51 collector.
52
48 -# Buffering Requests & Responses
49 -
50 -In general, requests to the gateway should be buffered by the reverse proxy for
51 -the best performance. This is usually enabled by default (`proxy_request_buffering`).
52 -
53 -## API
54 -
55 -The go-ipfs HTTP API (`/api/...`) starts sending a response before it's done
56 -reading the request. This allows it to, e.g., send back progress updates while
57 -adding a file to go-ipfs.
58 -
59 -However, these progress updates won't work if the HTTP reverse proxy is
60 -configured to buffer requests. While requests to the go-ipfs _gateway_ should
61 -usually be buffered for better performance, requests to the go-ipfs API should
62 -generally not be buffered.
63 -
64 -In NGINX, you can turn off buffering for the API with:
65 -
66 -```nginx
67 -server {
68 - ...
69 - location /api {
70 - ...
71 - proxy_request_buffering off;
72 - proxy_buffering off;
73 - proxy_http_version 1.1;
74 - }
75 -}
76 -```
77 -
78 -See: https://github.com/ipfs/go-ipfs/issues/6402#issuecomment-643025868
79 -
53 # Content Blocking
54
55 TODO: