mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2025-04-17 12:41:51 +00:00
* Docs: Streamline header naming * Docs: Mention the logout endpoint
This commit is contained in:
parent
51cacde445
commit
378a557782
2 changed files with 11 additions and 2 deletions
11
README.md
11
README.md
|
@ -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.
|
||||
|
|
2
main.go
2
main.go
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue