Francis Daly
July 01, 2020 04:06AM
On Tue, Jun 30, 2020 at 09:19:40PM -0400, latha wrote:

Hi there,

> I have the below config, calling /v2/test/status calls the
> http://test.svc.cluster.local:9080/status. But the named location `acreate`
> is not being called. http://test.svc.cluster.local:9080/status does return
> `X-Accel-Redirect: @acreate` in response header.

The below config works for me, as the tests show.

Can you show the results of similar tests, to see where the difference is?

Configuration:

==
server {
listen 6060;
location @named {
return 200 "In @named location 6060\n";
}
location ~ /v2/test(.*)$ {
set $serv http://127.0.0.1:9080$1;
proxy_pass $serv;
}
}
server {
listen 9080;
return 200 "In 9080, request was $request_uri\n";
add_header X-Accel-Redirect @named;
}
==
Test request/response pairs:

==
$ curl -i http://127.0.0.1:9080/direct
HTTP/1.1 200 OK
Server: nginx/1.17.2
[snip]
X-Accel-Redirect: @named

In 9080, request was /direct

$ curl -i http://127.0.0.1:6060/v2/test/status
HTTP/1.1 200 OK
Server: nginx/1.17.2
[snip]

In @named location 6060
==

You indicate that you don't get the response that you want.

What response do you get?

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

X-Accel-Redirect not redirecting to named locaiton

latha June 30, 2020 09:19PM

Re: X-Accel-Redirect not redirecting to named locaiton

Francis Daly July 01, 2020 04:06AM

Re: X-Accel-Redirect not redirecting to named locaiton

latha July 07, 2020 08:01PM

Re: X-Accel-Redirect not redirecting to named locaiton

Francis Daly July 19, 2020 03:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 235
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready