@@ -28,8 +28,8 @@ func mainFlagSet() *flag.FlagSet {
28
28
flagSet .String ("tls-cert" , "" , "path to certificate file" )
29
29
flagSet .String ("tls-key" , "" , "path to private key file" )
30
30
flagSet .String ("redirect-url" , "" , "the OAuth Redirect URL. ie: \" https://internalapp.yourcompany.com/oauth2/callback\" " )
31
- flagSet .Bool ("set-xauthrequest" , false , "set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)" )
32
31
flagSet .Var (& upstreams , "upstream" , "the http url(s) of the upstream endpoint or file:// paths for static files. Routing is based on the path" )
32
+ flagSet .Bool ("set-xauthrequest" , false , "set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)" )
33
33
flagSet .Bool ("pass-user-headers" , true , "pass X-Forwarded-User and X-Forwarded-Email information to upstream" )
34
34
flagSet .Bool ("pass-basic-auth" , true , "pass HTTP Basic Auth header to upstream" )
35
35
flagSet .String ("basic-auth-password" , "" , "the password to set when passing the HTTP Basic Auth header" )
@@ -70,6 +70,7 @@ func mainFlagSet() *flag.FlagSet {
70
70
flagSet .Bool ("cookie-secure" , true , "set secure (HTTPS) cookie flag" )
71
71
flagSet .Bool ("cookie-httponly" , true , "set HttpOnly cookie flag" )
72
72
73
+ flagSet .Bool ("xheaders" , true , "Trust X-Real-IP request header (appropriate when behind a reverse proxy)" )
73
74
flagSet .Bool ("request-logging" , true , "Log requests to stdout" )
74
75
flagSet .String ("request-logging-format" , defaultRequestLoggingFormat , "Template for request log lines" )
75
76
@@ -142,7 +143,7 @@ func main() {
142
143
}
143
144
144
145
s := & Server {
145
- Handler : LoggingHandler (os .Stdout , oauthproxy , opts .RequestLogging , opts .RequestLoggingFormat ),
146
+ Handler : LoggingHandler (os .Stdout , oauthproxy , opts .RequestLogging , opts .XHeaders , opts . RequestLoggingFormat ),
146
147
Opts : opts ,
147
148
}
148
149
s .ListenAndServe ()
0 commit comments