Make a subrequest to server from nginx to implement authentication and serve page based on authentication subrequest result.
NGINX can authenticate each request with an external server or service. To perform authentication, NGINX makes an HTTP subrequest to an external server where the subrequest is verified. If the subrequest returns a 2xx response code, the access is allowed, if it returns 401or 403, the access is denied.
Make a subrequest to server from nginx to implement authentication and serve page based on authentication subrequest result.
NGINX can authenticate each request with an external server or service. To perform authentication, NGINX makes an HTTP subrequest to an external server where the subrequest is verified. If the subrequest returns a
2xx
response code, the access is allowed, if it returns401
or403
, the access is denied.Article: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-subrequest-authentication/
Nginx regex tests: https://nginx.viraptor.info/