Skip to content
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

proxy_intercept_errors off parameter does not work for me on nginx 404 response code #12430

Open
jurajnovotny opened this issue Nov 29, 2024 · 1 comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@jurajnovotny
Copy link

jurajnovotny commented Nov 29, 2024

Hello, I am trying to extend a bit our configuration of ingress by adding server-snippet config under controller.config.server-snippet. The goal is to add 1 extra header to the all responses coming directly from NGINX.

So far I have it like that: (I know I can simplify it by putting it together)

controller
  config: 
    server-snippet: |
        error_page 503 @custom_503;
        error_page 404 @custom_404;
  
        proxy_intercept_errors off;
        
        location @custom_503 {
          internal;
          set $operation_id $request_id;
          add_header NGINX $operation_id always;
          return 503;
        }
  
        location @custom_404 {
          internal;
          set $operation_id $request_id;
          add_header NGINX $operation_id always;
          return 404;
        }

The 503 seems to work so far, but 404 part does not work at all when proxy_intercept_errors is set to OFF. Even on the ones that are 100% from NGINX. When I turn it on, it works, but it put that extra header on every single response, even on the ones that are not from NGINX.

I understand proxy_intercept_errors parameter as parameter that separates managing responses that comes directly from NGINX and the others.

So am I missing something or should I look at 404 response differently than at the 503?

Thank you so much !

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 29, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

No branches or pull requests

2 participants