Files
FreshRSS/docs/en/admins/Caddy.md
dependabot[bot] 7d86cbe804 Bump markdownlint-cli from 0.44.0 to 0.45.0 (#7632)
* Bump markdownlint-cli from 0.44.0 to 0.45.0

Bumps [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/igorshubovych/markdownlint-cli/releases)
- [Commits](https://github.com/igorshubovych/markdownlint-cli/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: markdownlint-cli
  dependency-version: 0.45.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix Markdown

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-06-01 22:50:58 +02:00

3.3 KiB

Using Caddy as a Reverse Proxy

How to configure Caddy as a reverse proxy to serve FreshRSS through a subfolder or subdomain

Using Caddy as a Reverse Proxy with a Subfolder

To set up FreshRSS behind a reverse proxy with Caddy and using a subfolder, follow these steps:

  1. Configure Caddyfile:

    Update your Caddyfile with the following configuration:

    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 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:

    'base_url' => 'https://example.com/subfolder',
    

    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:

    docker compose restart caddy
    

    Restart FreshRSS to ensure that it recognizes the new base URL:

    docker compose restart freshrss
    
  4. Access FreshRSS:

    FreshRSS should now be accessible at https://example.com/subfolder.

Using Caddy as a Reverse Proxy with a Subdomain

To set up FreshRSS behind a reverse proxy with Caddy and using a subdomain, follow these steps:

  1. Configure Caddyfile:

    Update your Caddyfile with the following configuration:

    subdomain.example.com { # The url Caddy should serve the proxy on
    	reverse_proxy freshrss:80 # Enables the reverse proxy for the configured program:port
    }
    

    Replace example.com with your actual domain and subdomain 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. NOTE: Make sure to set the DNS Records for your configured subdomain.

  2. Update FreshRSS Configuration:

    Open the config.php file in your FreshRSS installation and update the base_url parameter to match the subdomain configuration:

    'base_url' => 'https://subdomain.example.com/',
    

    Replace example.com with your actual domain and subdomain with the same subdomain specified in the Caddyfile.

  3. Restart Caddy and FreshRSS:

    Restart Caddy to apply the configuration changes:

    docker compose restart caddy
    

    Restart FreshRSS to ensure that it recognizes the new base URL:

    docker compose restart freshrss
    
  4. Access FreshRSS:

    FreshRSS should now be accessible at https://subdomain.example.com/.