<div dir="ltr">That definitely helped!  I didn't realize I could stack like that exactly.   Getting a 502 from localhost queries now, I can work on that.  Thanks for the quick reply!<div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 19, 2017 at 2:08 PM Grzegorz Kulewski <<a href="mailto:gk@leniwiec.biz">gk@leniwiec.biz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">W dniu 19.10.2017 o 20:59, John Baird pisze:<br>
> I have been doing some reading an googling, and I am wondering if someone can help.<br>
><br>
> I have an oauth2 service successfully authenticating nginx visitors.  Because Nginx is fronting a web application on the backend, the web application does NOT have valid domain credentials to interact with the nginx layer.<br>
><br>
> Goal:<br>
> I would like to be able to do something like the following:<br>
><br>
> geo $localhost {<br>
>   default 0;<br>
>   <a href="http://127.0.0.1/32" rel="noreferrer" target="_blank">127.0.0.1/32</a> <<a href="http://127.0.0.1/32" rel="noreferrer" target="_blank">http://127.0.0.1/32</a>> 1;<br>
> }<br>
><br>
> server {<br>
>   location / {<br>
>     if ($localhost = 0) {<br>
>       auth_request = /oauth2/callback<br>
>       ....<br>
>     }<br>
>   }<br>
> }<br>
><br>
> Is this possible?<br>
> TL;DR -> bypass nginx oauth2 auth_request module when source ip is localhost<br>
<br>
If I understood correctly something like that should work:<br>
<br>
satisfy any;<br>
allow 127.0.0.1;<br>
deny all;<br>
auth_request ...;<br>
<br>
--<br>
Grzegorz Kulewski<br>
</blockquote></div>