Answer the question
In order to leave comments, you need to log in
Sending a post request to the server gives an error - what's wrong?
I collect everything in the docker.
I send a request to 192.168.1.200:8585/IdentityAccess/test in which jwt-validation.lua is processed using socket.http.
local res, code, response_headers = http.request{
-- url = "http://192.168.1.200:86/test",
url = "http://192.168.1.200:8585/IdentityAccess/test2",
method = "POST",
headers =
{
["Content-Type"] = "application/x-www-form-urlencoded";
["Content-Length"] = #request_body;
},
source = ltn12.source.string(request_body),
sink = ltn12.sink.table(response_body),
}
ngx.say(res)
location /IdentityAccess/test {
fastcgi_ignore_client_abort on;
proxy_ignore_client_abort on;
rewrite_by_lua_file 'jwt-validation.lua';
rewrite ^/IdentityAccess^/ /$1 break;
proxy_pass http://identityaccess/test;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /IdentityAccess/test2 {
fastcgi_ignore_client_abort on;
proxy_ignore_client_abort on;
rewrite ^/IdentityAccess^/ /$1 break;
proxy_pass http://identityaccess/test2;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question