Hi Everybody,
First, I hope the question has never been asked ...
I am using NGinx as a reverse proxy and load balancing with upstream.
This is working perfectly, BUT I have to send a return code "404" when a specific header is returned from proxy.
I tried this in my server section :
<code>
location / {
proxy_pass http://myupstream;
if ( $upstream_http_myheader ) {
return 404;
}
}
</code>
This config doesn't work, i'm sure the header is valid because i receive it on client side and the "add_header testheader $upstream_http_myheader" in location section works fine also.
I think the if statement is made before the proxy_pass, but i hope i'm wrong.
Does anybody have a solution for me ?
Best regards,
Ben.
First, I hope the question has never been asked ...
I am using NGinx as a reverse proxy and load balancing with upstream.
This is working perfectly, BUT I have to send a return code "404" when a specific header is returned from proxy.
I tried this in my server section :
<code>
location / {
proxy_pass http://myupstream;
if ( $upstream_http_myheader ) {
return 404;
}
}
</code>
This config doesn't work, i'm sure the header is valid because i receive it on client side and the "add_header testheader $upstream_http_myheader" in location section works fine also.
I think the if statement is made before the proxy_pass, but i hope i'm wrong.
Does anybody have a solution for me ?
Best regards,
Ben.