I have a server on which I run several subdomain sites with nginx
each subdomain has a server { ... } block in the configuration (in sites-enabled )
I want to add a dynamic global authentication server (another http site) that will check the requested subdomain and provide access or request user credentials
so the stream should be like
request stie1.example.com ---> [auth check in database] / \ no yes / \ show username/pass form pass to site1.example.com
I found the auth_request module, but the examples are only about the server context
and I want it in a top-level context ( http context) - where, of course, the location directive is not available
So basically what I want is a kind of global nginx middleware where I can run some code (like python) to check if the user has permission to view one of the hosted domains
any suggestions?
nginx
Pydev UA
source share