git.iko.soy/typeable/oauth2-proxy
on master help sign in
README: simplify nginx auth_request example
7f5672bPierce Lopez
README.md+3−14
@@ -350,15 +350,10 @@ The [Nginx `auth_request` directive](http://nginx.org/en/docs/http/ngx_http_auth
350
350
351```nginx
351```nginx
352server {
352server {
353− listen 443 ssl spdy;
353+ listen 443 ssl;
354 server_name ...;
354 server_name ...;
355 include ssl/ssl.conf;
355 include ssl/ssl.conf;
356
356
357− location = /oauth2/auth {
358− internal;
359− proxy_pass http://127.0.0.1:4180;
360− }
361−
362 location /oauth2/ {
357 location /oauth2/ {
363 proxy_pass http://127.0.0.1:4180;
358 proxy_pass http://127.0.0.1:4180;
364 proxy_set_header Host $host;
359 proxy_set_header Host $host;
@@ -367,7 +362,7 @@ server {
367 proxy_set_header X-Auth-Request-Redirect $request_uri;
362 proxy_set_header X-Auth-Request-Redirect $request_uri;
368 }
363 }
369
364
370− location /upstream/ {
365+ location / {
371 auth_request /oauth2/auth;
366 auth_request /oauth2/auth;
372 error_page 401 = /oauth2/sign_in;
367 error_page 401 = /oauth2/sign_in;
373
368
@@ -379,13 +374,7 @@ server {
379 proxy_set_header X-Email $email;
374 proxy_set_header X-Email $email;
380
375
381 proxy_pass http://backend/;
376 proxy_pass http://backend/;
382− }
383−
384− location / {
385− auth_request /oauth2/auth;
386− error_page 401 = https://example.com/oauth2/sign_in;
387−
388− root /path/to/the/site;
377+ # or "root /path/to/site;" or "fastcgi_pass ..." etc
389 }
378 }
390}
379}
391```
380```