Skip to content

[Fix] Caddy force-ssl verification#1130

Merged
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/caddy-verification-fix
May 25, 2026
Merged

[Fix] Caddy force-ssl verification#1130
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/caddy-verification-fix

Conversation

@RichardAnderson

Copy link
Copy Markdown
Member

Like nginx, when caddy is in force-ssl mode, vito domain verification does not function, this PR allows us to support HTTP requests to the verify URL even when force-ssl is enabled.

Copilot AI left a comment

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.

Pull request overview

This PR fixes hosted-domain verification for the Caddy webserver when TLS is enabled (Caddy “auto HTTPS” / force-SSL-style behavior), by ensuring the /.well-known/vito/... verification endpoint remains reachable over plain HTTP (port 80) even when the rest of the site redirects to HTTPS.

Changes:

  • Add a dedicated HTTP (http://...) Caddy server block that serves the verification path and redirects all other requests to HTTPS.
  • Extend the Caddy config generator to compute the HTTP-only verification domains list and expose it to the Mustache template.
  • Add feature tests to assert the new HTTP verification behavior and ensure it’s omitted for HTTP-only sites.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Feature/Webserver/VerificationBlockTest.php Adds coverage for Caddy HTTP verification behavior when TLS is enabled, plus a helper to switch the server to Caddy.
resources/views/ssh/services/webserver/caddy/vhost.mustache Adds an explicit http:// server block to serve verification and redirect everything else to HTTPS.
app/Actions/Webserver/GenerateCaddyConfig.php Populates has_http_verification and http_verification_domains template data based on generated server blocks.

@RichardAnderson RichardAnderson merged commit c1faf20 into vitodeploy:4.x May 25, 2026
3 checks passed
@RichardAnderson RichardAnderson deleted the fix/caddy-verification-fix branch May 25, 2026 22:59
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.

3 participants