Skip to content

Commit 1c36e6f

Browse files
committed
Improve recommendations for gRPC network handlers
Updates recommendations to highlight the `h2_backend` option.
1 parent 754b861 commit 1c36e6f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

networking/services.html.markerb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ You can also configure [TLS options](/docs/reference/configuration/#http_service
112112

113113
Many apps have limited HTTP support, the `http` handler normalizes HTTP connections and sends HTTP 1.1 requests to the application process. This is roughly how `nginx` and other reverse proxies work, and allows your app to globally accept modern HTTP protocols (like HTTP/2) without extra complexity.
114114

115-
If your application stack has good HTTP/2 support (like Go), you will get better performance accepting TCP connections directly, and using the TLS handler to terminate SSL. Your app _does_ need to understand `h2c` for this to work, however.
115+
If your application stack requires HTTP/2 (like gRPC), enable the `h2_backend` to speak over HTTP/2 directly. Your app _does_ need to understand `h2c` for this to work, however.
116116

117117
The HTTP handler adds a number of standard HTTP headers to requests, and a few Fly.io-specific headers for convenience:
118118

@@ -151,7 +151,7 @@ You can force routing to a specific machine instance:
151151
Fly-Force-Instance-Id: instance-number
152152
```
153153

154-
Configuration example in `fly.toml`:
154+
Configuration examples in `fly.toml`:
155155

156156
```toml
157157
[[services]]
@@ -162,16 +162,19 @@ Configuration example in `fly.toml`:
162162
force_https = true # optional
163163
```
164164

165+
```toml
166+
[http_service]
167+
...
168+
[http_service.http_options]
169+
h2_backend = true
170+
```
171+
165172
### TLS handler
166173

167174
The `tls` handler terminates TLS using Fly.io-managed application certificates, then forwards a plaintext connection to the application process. This is useful for running TCP services and offloading `TLS` to the Fly Proxy.
168175

169176
For performance purposes, the Fly Proxy will terminate TLS on the host a client connects to, and then forward the connection to the nearest available Machine.
170177

171-
<div class="note icon">
172-
**Note:** The TLS handler includes ALPN negotiation for HTTP/2. When possible, apps will connect to these kinds of Fly.io services using HTTP/2, and we will forward an unencrypted HTTP/2 connection (`h2c`) to the application process.
173-
</div>
174-
175178
Configuration examples in `fly.toml`:
176179

177180
```toml

0 commit comments

Comments
 (0)