lighttpd - Redirect based upon script output? -
i'd redirect "/" based upon output of bash script. script returns 0 or 1.
i have inherited lighttpd server no experience hoping can help. :)
basically want:
on accessing url if script output returns 1 redirect /index.php else redirect url
is possible lighttpd? trying avoid spinning php process simple.
you might (ab)use mod_fastcgi authorizer mode this, , have script return 302 found location: ... target url of choice. https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modfastcgi
however, this, script must fastcgi script, or can start wrapper such spawn-fcgi https://github.com/lighttpd/spawn-fcgi (or can write script in c , use example code in docs_modfastcgi page above) (or can use python , see https://redmine.lighttpd.net/projects/lighttpd/wiki/howtopythonwsgi )
Comments
Post a Comment