Skip to content

docs: resolve HaRP per request and pass WebSockets in the nginx examples - #121

Merged
oleksandr-nc merged 3 commits into
mainfrom
docs/nginx-upstream-variable
Sep 25, 2026
Merged

oleksandr-nc merged 3 commits into
mainfrom
docs/nginx-upstream-variable

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

The nginx example uses an IP, so it never hits this: with a container name in proxy_pass, nginx resolves it once at startup and refuses to start whenever the HaRP container is absent (host not found in upstream), taking every vhost of that server down. Verified on nextcloud-docker-dev, where the proxy is nginx-proxy and HaRP is appapi-harp. The new example puts the upstream in a variable with a resolver, which degrades to a 502 on /exapps/ instead, and says when Docker's 127.0.0.11 resolver applies. Requested in nextcloud/nextcloud-skills#9.

Both nginx examples also dropped WebSockets: without proxy_http_version 1.1 and the Upgrade/Connection headers nginx never forwards the upgrade, so ExApp WebSockets did not reach HaRP even though HaRP supports them.

With a container name in proxy_pass, nginx refuses to start whenever that container is absent and the whole server block goes down; a variable plus a resolver avoids it.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d7edee4d-a356-4b15-afcc-ecc344248836

📥 Commits

Reviewing files that changed from the base of the PR and between ad17d3b and 2c4a1e4.

📒 Files selected for processing (1)
  • README.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The README NGINX example now sets HTTP/1.1 and the Upgrade and Connection headers for WebSocket proxying. It adds a complete alternative server block with a resolver, proxy headers, and a timeout. The guidance limits Docker’s 127.0.0.11 resolver to containers on user-defined networks and directs other cases to the plain proxy_pass form.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 2c4a1

The README now documents WebSocket forwarding and a resolver-based alternative for container DNS names. The examples preserve the server settings and explain when to use each, with no identified blocker to merging.

Architecture Summary

Architecture risk: 🔵 Low · up to 2c4a1

The change affects 1 system.

Changed systems: README.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — README.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in README.md: The standard NGINX example adds HTTP/1.1 and Upgrade/Connection headers for WebSocket proxying.
  • observed — Modified behavior in README.md: Adds an explanation of the WebSocket headers and expands the DNS-name alternative from a partial location block to a complete server block with proxy headers and timeout. The instructions specify using it instead of the original block; they also limit Docker’s 127.0.0.11 resolver to containers on user-defined networks and direct default-bridge, host-nginx, and /etc/hosts name cases to the plain proxy_pass form.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main changes: per-request HaRP resolution and WebSocket forwarding in the NGINX examples.
Description check ✅ Passed The description directly explains the resolver behavior, failure impact, Docker conditions, verification, and WebSocket changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f76bae30-e45b-4d8a-b760-f99cf50efc25

📥 Commits

Reviewing files that changed from the base of the PR and between 618751a and ad17d3b.

📒 Files selected for processing (1)
  • README.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread README.md
Comment thread README.md
Put the upstream in a variable, which nginx resolves per request, and give it a resolver:

```nginx
resolver 127.0.0.11 valid=30s; # Docker's embedded DNS; use your own resolver outside Docker

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe this is not required to be set?

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@oleksandr-nc oleksandr-nc changed the title docs: resolve a HaRP hostname per request in the nginx example docs: resolve HaRP per request and pass WebSockets in the nginx examples Sep 25, 2026
@oleksandr-nc
oleksandr-nc merged commit 1694848 into main Sep 25, 2026
17 checks passed
@oleksandr-nc
oleksandr-nc deleted the docs/nginx-upstream-variable branch September 25, 2026 12:48
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