Welcome! Log In Create A New Profile

Advanced

auth_request and fastcgi_pass can't use var? And what should I do ?

Posted by menfs 
auth_request and fastcgi_pass can't use var? And what should I do ?
May 03, 2018 02:42AM
Hello,
I want to see $token to $tk not "$tk" and I think nginx doesn't understand two variables. But I can be not right, actually.
I have to cut out some part from uri and use that in sub-request. Is there some workaround for that?

my conf for that https://pastebin.com/u0ddzD3H and it doesn't work
Re: auth_request and fastcgi_pass can't use var? And what should I do ?
May 03, 2018 07:08AM
I've solved this with

location ~ '^/el/(?<tk>.+)/(?<tail>php/\d/[\w+/\.-=_]+)?$' {
set $auth_request_uri "http://127.0.0.1:10101/auth/$tk";
auth_request /auth;
autoindex on;
alias /var/ftp/pub/centos/php/$tail;

}

location /auth {
internal;
proxy_pass $auth_request_uri;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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