2013-10-15 10:11:39 +02:00
|
|
|
SSOwat
|
|
|
|
======
|
|
|
|
|
|
|
|
A simple SSO for nginx, written in Lua
|
|
|
|
|
2013-10-15 10:16:42 +02:00
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
|
|
|
Nginx "Openresty" flavored : http://openresty.org/
|
|
|
|
|
|
|
|
|
2013-10-15 10:11:39 +02:00
|
|
|
Example Nginx conf
|
|
|
|
------------------
|
|
|
|
|
2013-10-15 10:13:34 +02:00
|
|
|
```nginx
|
|
|
|
|
2013-10-15 10:11:39 +02:00
|
|
|
lua_package_path "/usr/share/lua/5.1/nginx/?.lua;;"; # For Debian
|
|
|
|
init_by_lua_file path/to/init.lua;
|
|
|
|
access_by_lua_file path/to/access.lua;
|
|
|
|
|
|
|
|
# SSO domain
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name mydomain.com;
|
|
|
|
|
|
|
|
location = /ssowat/ {
|
|
|
|
root /var/www/portal;
|
|
|
|
index login.html;
|
|
|
|
add_header Content-Type text/html;
|
|
|
|
}
|
|
|
|
|
|
|
|
location = /whatever/ {
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# Other domain
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name myotherdomain.com;
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-10-15 10:13:34 +02:00
|
|
|
```
|