You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: networking/services.html.markerb
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ You can also configure [TLS options](/docs/reference/configuration/#http_service
112
112
113
113
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.
114
114
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.
116
116
117
117
The HTTP handler adds a number of standard HTTP headers to requests, and a few Fly.io-specific headers for convenience:
118
118
@@ -151,7 +151,7 @@ You can force routing to a specific machine instance:
151
151
Fly-Force-Instance-Id: instance-number
152
152
```
153
153
154
-
Configuration example in `fly.toml`:
154
+
Configuration examples in `fly.toml`:
155
155
156
156
```toml
157
157
[[services]]
@@ -162,16 +162,19 @@ Configuration example in `fly.toml`:
162
162
force_https = true # optional
163
163
```
164
164
165
+
```toml
166
+
[http_service]
167
+
...
168
+
[http_service.http_options]
169
+
h2_backend = true
170
+
```
171
+
165
172
### TLS handler
166
173
167
174
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.
168
175
169
176
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.
170
177
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.
0 commit comments