in-process I think it's a no-go, as nginx just doesn't know how to interpret python in the same process as apache does. http_auth_request together with http_access though can help, as you should be able to code an handler that returns either 200 or 403 instead of true/false . Check http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
On Friday, October 14, 2016 at 3:50:05 AM UTC+2, Massimo Di Pierro wrote: > > Does anybody here know how port these links to Nginx? > > > <VirtualHost *:80> > > ScriptAlias /bin/ "/whatever/cgi-bin/" > > <Directory "/whatever/cgi-bin"> > > WSGIAccessScript /whatever/access.wsgi > > </Directory> > > </VirtualHost> > > > They basically say that some URLs /whatever/cgi-bin point to legacy > cgi-bin scripts but before executing the scripts it should pass the > environment vars and the header info to the access.wsgi python script to > ask for access permission. This allows me to have a web2py app that links > the legacy scripts and because on the same domain, the client passes the > session cookie, the access.wsgi code retrieves the session cookie and check > permissions. > > > The script looks like this: > > > def allow_access(environ,host): > > # get credentials from environ, ask web2py is user is authorized and > return true/false > > > I am happy to rewrite the script but the question is whether nginx > provides an equivalent mechanism. I cannot find one. > > > Massimo > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.