I am trying to write a plugin to do proprietary security auth follow (send secret data to an endpoint, once verified, it redirects you back to your routes (that can be protected or not), after it gives a 200.
But I am confused what I really need. Here’s what my nginx config looks like, and I want to get away from it:
location = @login {
internal ;
rewrite ^ "https://secure-login-host-verifier/login" redirect;
}
location = @validate {
internal ;
proxy_http_version 1.1;
proxy_pass "https://secure-login-host-verifier/validate";
proxy_pass_request_body "on";
proxy_set_header Host SET_CORRECT_HEADER
}
location / {
auth_prot "on"; #protect this route - can be selectively turned on and off for let's say *.png files, etc.
proxy_connect_timeout 15s;
proxy_http_version 1.1;
proxy_pass http://my-app-host;
proxy_set_header SET_HEADERS_HERE_WITH_META_FROM_LOGIN-VERIFICATION-HOST
}
How do I get started?
I’ll write a wiki for this if I get it done – with basics on it – right . I read it mholt’s twitter that people want more examples but they are not willing to share theirs…