Skip to content

Update reverse-proxies.rst #5557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update reverse-proxies.rst #5557

wants to merge 2 commits into from

Conversation

rev111
Copy link

@rev111 rev111 commented Jun 1, 2025

Corrected reverse proxying subdirectories with Caddy. Former description would not strip the subdirectory from the reverse proxy target. Changed documentation accordingly. Added an additional paragraph how stripping the subdirectory should be configured in Caddys configuration file. Source: Spent an afternoon figuring this out after unsuccesful application of this doc to a CouchDB+Caddy setup.

Overview

Corrected documentation regarding reverse proxying subdirectories with Caddy. Former description would not strip the subdirectory from the reverse proxy target as described. Changed documentation accordingly. Added an additional paragraph how stripping the subdirectory should be configured in Caddys configuration file. Source: Spent an afternoon figuring this out after unsuccesful application of this doc to a CouchDB+Caddy setup.

Testing recommendations

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • [ X] Documentation changes were made in the src/docs folder
  • Documentation changes were backported (separated PR) to affected branches

Corrected reverse proxying subdirectories with Caddy. Former description would not strip the subdirectory from the reverse proxy target. Changed documentation accordingly.
Added an additional paragraph how stripping the subdirectory should be configured in Caddys configuration file.
Source: Spent an afternoon figuring this out after unsuccesful application of this doc to a CouchDB+Caddy setup.
Copy link
Contributor

@big-r81 big-r81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thank you for your contribution. Only a small syntax change is necessary.

Comment on lines 239 to 240


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these two (out of three) empty lines.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the lines and appended the text a bit.
Also line 283 in chapter "Authentication with Caddy 2 as a reverse proxy" possibly contains a mistake when stating "This setup leans entirely on nginx performing...". I'm not sure if it is correct, or it should be "caddy" instead of "nginx", or if the paragraph has been erroneously copied from the identical paragraph in the nginx chapter at line 148 and was accidentally left, so I did not change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch! Looks like a copy/paste error. We would be pleased if you could fix this error at the same time and while you have a working caddy setup, can you test/evaluate the provided config samples if these are correct?

Removed empty lines as requested. Added a short description of the "uri strip_prefix" directive.
To proxy the URL ``http(s)://domain.com/couchdb`` to
``http://localhost:5984`` so that requests appended to the subdirectory, such
as ``http(s)://domain.com/couchdb/db1/doc1`` are proxied to
``http://localhost:5984/db1/doc1``, you have to configure a route in Caddy and strip the subdirectory from the target URI with ``uri strip_prefix``:
Copy link
Contributor

@big-r81 big-r81 Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the linter complains about this long line. please add a line break (max. 90 chars).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants