Skip to content

Commit b44d0fe

Browse files
authored
Revise reverse proxy guide for clarity and updates
Updated the title and section headers for clarity. Added details on configuring Fiber to trust proxy headers and updated the list of popular reverse proxies.
1 parent d36dbb4 commit b44d0fe

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

docs/guide/reverse-proxy.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: reverse-proxy
3-
title: Reverse Proxies
3+
title: reverse-proxy
44
description: >-
55
Learn how to set up reverse proxies like Nginx or Traefik to enable modern
66
HTTP capabilities in your Fiber application, including HTTP/2 and the
@@ -9,8 +9,10 @@ description: >-
99
sidebar_position: 4
1010
---
1111

12-
# Reverse Proxies
13-
## Enabling HTTP/2
12+
## Reverse Proxies
13+
14+
### Enabling HTTP/2
15+
1416
Some features in Fiber, such as SendEarlyHints, require HTTP/2 or newer. If your app is served directly over HTTP/1.1, certain features may be ignored or not function as expected.
1517

1618
To enable HTTP/2 in production, run Fiber behind a reverse proxy that upgrades connections. Popular choices include Nginx and Traefik.
@@ -27,16 +29,14 @@ server {
2729
ssl_certificate_key /etc/ssl/private/example.key;
2830
2931
location / {
30-
proxy_set_header X-Real-IP $remote_addr;
31-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32-
proxy_set_header X-Forwarded-Proto $scheme;
3332
proxy_pass http://127.0.0.1:3000;
3433
proxy_http_version 1.1;
3534
proxy_set_header Connection "";
3635
proxy_set_header Host $host;
3736
}
3837
}
3938
```
39+
4040
This configuration enables HTTP/2 with TLS and proxies requests to your Fiber app on port 3000.
4141
</details>
4242
<details>
@@ -62,10 +62,12 @@ http:
6262
servers:
6363
- url: "http://127.0.0.1:3000"
6464
```
65+
6566
With this configuration, Traefik terminates TLS and serves your app over HTTP/2.
66-
</details>\n\n### Configuring Fiber\n\nWhen your application is behind a proxy, you must configure Fiber to trust the proxy headers so that information like the client's IP address and protocol are correctly parsed. You can do this via the `ProxyHeader` configuration.\n\n```go\napp := fiber.New(fiber.Config{\n // For Nginx, you might use X-Real-IP or X-Forwarded-For\n ProxyHeader: fiber.HeaderXForwardedFor,\n})\n```\n\nFor more details, see the [configuration documentation on `ProxyHeader`](../api/fiber.md#proxyheader).
67+
</details>
68+
69+
### HTTP/3 (QUIC) Support
6770
68-
## HTTP/3 (QUIC) Support
6971
Early Hints (103 responses) are officially part of HTTP/2 and newer. Many reverse proxies also support HTTP/3 (QUIC):
7072
7173
- **Nginx**: Requires a recent build with QUIC/HTTP3 patches.
@@ -79,7 +81,8 @@ For more details, see the official documentation:
7981
- [Nginx QUIC / HTTP/3](https://nginx.org/en/docs/quic.html)
8082
- [Traefik HTTP/3](https://doc.traefik.io/traefik/reference/install-configuration/entrypoints/#http3)
8183
82-
## Popular Reverse Proxies
84+
Few of the available Reverse Proxies
85+
8386
- [Nginx](https://nginx.org/)
84-
- [Traefik](https://traefik.io/)
85-
- [HAProxy](https://www.haproxy.org/)
87+
- [Traefik](https://traefik.io/?gad_campaignid=20537010384)
88+
- [HA PROXY](https://www.haproxy.com/documentation/)

0 commit comments

Comments
 (0)