diff options
| author | 2025-01-08 08:40:50 +0100 | |
|---|---|---|
| committer | 2025-01-08 08:40:50 +0100 | |
| commit | fa701b39f3775ac4250a82fabcec8970b446789b (patch) | |
| tree | 1979a5f352af31969022f2f4dea3ccd4d358b6c4 /docs | |
| parent | 927504e74a295355d5521552dbd9e2745cff3760 (diff) | |
Simplify the Caddy configuraton (#7194)
* Simplify Caddyfile configuraton
* Fix missing bracket :)
* Fix failing test
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/en/admins/Caddy.md | 62 |
1 files changed, 15 insertions, 47 deletions
diff --git a/docs/en/admins/Caddy.md b/docs/en/admins/Caddy.md index 9f19113d4..c4b4c2815 100644 --- a/docs/en/admins/Caddy.md +++ b/docs/en/admins/Caddy.md @@ -8,42 +8,37 @@ To set up FreshRSS behind a reverse proxy with Caddy and using a subfolder, foll Update your Caddyfile with the following configuration: - ```plaintext - example.com { - redir /freshrss /freshrss/i/ - route /freshrss* { - uri strip_prefix /freshrss - reverse_proxy freshrss:80 { - header_up Host {host} - header_up X-Real-IP {remote} - header_up X-Forwarded-Proto {scheme} - header_up X-Forwarded-Host {host} - header_up X-Forwarded-For {remote} - header_up X-Forwarded-Ssl {on} - header_up X-Forwarded-Prefix "/freshrss/" - } - } - } + ``` caddy + example.com { + redir /subfolder /subfolder/ # Just to redirect users that are missing the closing slash to the correct page + handle_path /subfolder/* { # Actually configures the used subfolder (also internally strips the path prefix) + reverse_proxy freshrss:80 { # Enables the reverse proxy for the configured program:port + header_up X-Forwarded-Prefix "/subfolder" # Sets the correct header for the login cookies + } + } + } ``` - Replace `example.com` with your actual domain and `freshrss` with the subfolder where FreshRSS is hosted. + Replace `example.com` with your actual domain and the four instances of `subfolder` with the subfolder where you want FreshRSS to be hosted. + + > **_NOTE:_** Ensure that the Docker container name for FreshRSS (freshrss in this example) matches the name used in the Caddyfile configuration. 2. **Update FreshRSS Configuration:** Open the `config.php` file in your FreshRSS installation and update the `base_url` parameter to match the subfolder configuration: ```php - 'base_url' => 'https://example.com/freshrss', + 'base_url' => 'https://example.com/subfolder', ``` - Replace `example.com` with your actual domain and `freshrss` with the subfolder name specified in the Caddyfile. + Replace `example.com` with your actual domain and `subfolder` with the same subfolder name specified in the Caddyfile. 3. **Restart Caddy and FreshRSS:** Restart Caddy to apply the configuration changes: ```bash - systemctl restart caddy + docker compose restart caddy ``` Restart FreshRSS to ensure that it recognizes the new base URL: @@ -55,30 +50,3 @@ To set up FreshRSS behind a reverse proxy with Caddy and using a subfolder, foll 4. **Access FreshRSS:** FreshRSS should now be accessible at `https://example.com/freshrss`. - -### Example Caddyfile Entry - -```plaintext -example.com { - redir /freshrss /freshrss/i/ - route /freshrss* { - uri strip_prefix /freshrss - reverse_proxy freshrss:80 { - header_up Host {host} - header_up X-Real-IP {remote} - header_up X-Forwarded-Proto {scheme} - header_up X-Forwarded-Host {host} - header_up X-Forwarded-For {remote} - header_up X-Forwarded-Ssl {on} - header_up X-Forwarded-Prefix "/freshrss/" - } - } -} -``` - -Replace `example.com` with your actual domain and `freshrss` with the subfolder name where FreshRSS is hosted. - -### Note - - -Ensure that the Docker container name for FreshRSS (freshrss in this example) matches the name used in the Caddyfile configuration. By following these steps, you should be able to successfully configure Caddy as a reverse proxy with a subfolder for FreshRSS. Remember to update the base_url parameter in the FreshRSS configuration to match the subfolder configuration set in Caddy. |
