1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 07:34:22 +00:00

[#19] Documentation improvements (#20)

* Docs: Streamline header naming
* Docs: Mention the logout endpoint
This commit is contained in:
Knut Ahlers 2018-11-18 12:24:33 +01:00 committed by GitHub
parent 51cacde445
commit 378a557782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -43,6 +43,13 @@ server {
proxy_pass http://127.0.0.1:1720/;
}
# If the user is lead to /logout redirect them to the logout endpoint
# of ngninx-sso which then will redirect the user to / on the current host
location /logout {
# Another server{} directive also proxying to http://127.0.0.1:8082
return 302 https://login.luzifer.io/logout?go=$scheme://$http_host/;
}
location /sso-auth {
# Do not allow requests from outside
internal;
@ -53,7 +60,7 @@ server {
proxy_set_header Content-Length "";
# Set custom information for ACL matching: Each one is available as
# a field for matching: X-Host = x-host, ...
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Origin-URI $request_uri;
proxy_set_header X-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -69,6 +76,8 @@ server {
}
```
To implement a logout you can send the user to the `/logout?go=<url>` endpoint which will ensure the cookie-stored login will be erased.
## Configuration
The configuration is mainly done using a YAML configuration file. Some options are configurable through command line flags and can be looked up using `--help` flag.

View file

@ -86,7 +86,7 @@ func init() {
mainCfg.Listen.Addr = "127.0.0.1"
mainCfg.Listen.Port = 8082
mainCfg.AuditLog.TrustedIPHeaders = []string{"X-Forwarded-For", "RemoteAddr", "X-Real-IP"}
mainCfg.AuditLog.Headers = []string{"x-origin-url"}
mainCfg.AuditLog.Headers = []string{"x-origin-uri"}
}
func loadConfiguration() error {