Welcome! Log In Create A New Profile

Advanced

"proxy_intercept_errors on" with @location setup

Fabiano Furtado Pessoa Coelho
September 16, 2021 03:28PM
Hello...

I have the following issue...

Is it possible to use "proxy_intercept_errors on" with @location?

Invalid config:
location /images/ {
proxy_intercept_errors on;
try_files $uri @backend;
}
location / {
try_files $uri @backend;
}
location @backend {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://my_upstream;
}

The only valid configuration I've found to intercept errors is not
using the @location but I want to use it to simplify the
configuration.

Valid config:
location /images/ {
proxy_intercept_errors on;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://my_upstream_config;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://my_upstream;
}

Thanks in advance.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

"proxy_intercept_errors on" with @location setup

Fabiano Furtado Pessoa Coelho September 16, 2021 03:28PM

Re: "proxy_intercept_errors on" with @location setup

Francis Daly September 16, 2021 06:38PM

Re: "proxy_intercept_errors on" with @location setup

Fabiano Furtado Pessoa Coelho September 17, 2021 01:38PM

Re: "proxy_intercept_errors on" with @location setup

Francis Daly September 18, 2021 03:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 50
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready