Welcome! Log In Create A New Profile

Advanced

Re: Как сделать auth request при SSI?

May 22, 2017 08:23PM
Maxim Dounin Wrote:
-------------------------------------------------------
> Если хочется какие-то ssi-фрагменты показывать в зависимости от
> результата auth_request, то следует использовать auth_request для
> основного запроса, и вернуть положительный результат, параллельно
> установив дополнительную переменную через auth_request_set. После
> чего проверять переменную с помощью, например, SSI-команды "if".

Спасибо за совет!
Не получается установить переменную: auth_request_set $x_allow_test2 $upstream_http_x_allow_test2;
Она всегда пустая. auth_request_set $server $upstream_http_server; тоже пустая.

Нашел аналогичный вопрос https://forum.nginx.org/read.php?2,233582,233586#msg-233586 , но так и не понял, как исправить Mistake #1.

Конфиг:
ssi on;

location = /test1.html {
auth_request /test_auth;
auth_request_set $x_allow_test2 $upstream_http_x_allow_test2;
}

location = /test2.html {
}

location = /test_auth {
add_header X-Allow-Test2 1;
return 200;
}


test1.html:
test1
<!--# if expr="$x_allow_test2 = 1" -->
<!--# include file="/test2.html" -->
<!--# endif -->
Subject Author Posted

Как сделать auth_request при SSI?

BorisK2 May 22, 2017 07:38AM

Re: Как сделать auth request при SSI?

Maxim Dounin May 22, 2017 08:52AM

Re: Как сделать auth request при SSI?

Maxim Dounin May 22, 2017 08:56AM

Re: Как сделать auth request при SSI?

BorisK2 May 22, 2017 08:35PM

Re: Как сделать auth request при SSI?

Maxim Dounin May 23, 2017 08:38AM

Re: Как сделать auth request при SSI?

BorisK2 May 22, 2017 08:23PM

Re: Как сделать auth request при SSI?

Maxim Dounin May 23, 2017 09:00AM

Re: Как сделать auth request при SSI?

BorisK2 May 23, 2017 06:10PM

Re: Как сделать auth request при SSI?

BorisK2 May 23, 2017 06:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
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