Skip to content

Add error handling to nginx export#4249

Merged
johngodley merged 3 commits into
trunkfrom
update/nginx-error-handling
Jul 6, 2026
Merged

Add error handling to nginx export#4249
johngodley merged 3 commits into
trunkfrom
update/nginx-error-handling

Conversation

@johngodley

Copy link
Copy Markdown
Owner

Add error support to nginx export output.

Copilot AI review requested due to automatic review settings July 5, 2026 19:34

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 adds support for exporting “error” actions to Nginx configuration output, generating location blocks and return <code>; directives so error-based redirects can be represented in the Nginx export format.

Changes:

  • Add Nginx export support for action_type === 'error' by emitting location blocks with return <status>;.
  • Update conditional (agent/referrer) export paths to emit either return (for errors) or rewrite (for URL actions) via a shared helper.
  • Add integration tests validating exact vs encoded locations and regex/case-insensitive location generation for error actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/integration/import-export/test-nginx.php Adds integration tests covering Nginx export output for error actions (exact, encoded, case-insensitive, regex).
includes/import-export/format/class-nginx.php Implements error-action handling in the Nginx exporter, including location-line generation and conditional action output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/import-export/format/class-nginx.php
@johngodley johngodley merged commit ef5dcdd into trunk Jul 6, 2026
8 checks passed
@johngodley johngodley deleted the update/nginx-error-handling branch July 6, 2026 16:26
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