Hi Igor<div><br></div><div>its ok i got it working now!</div><div><br></div><div>all i have to do was add this to my config</div><div><br></div><div><br></div><div><i>fastcgi_pass_header </i><span class="Apple-tab-span" style="white-space:pre"><i>        </i></span><i>Authorization;</i></div>
<div><br></div><div><br></div><div>i wasn't testing the HTTP request properly so wasn't seeing the results expected</div><div><br></div><div>Thank you very much!</div><div>made my work day</div><div><br></div><div>
<br></div><div><br><br><div class="gmail_quote">2009/7/23 Igor Sysoev <span dir="ltr"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Jul 23, 2009 at 11:22:19AM +0100, nginx.mailinglist wrote:<br>
<br>
> Thank you<br>
> I see that works fine for that particular user:pass combo<br>
><br>
> but (sorry to be a pain)<br>
><br>
> that means i have to encode the user:pass combination into the config file<br>
><br>
> what happens if there are thousands of user:pass combinations?<br>
><br>
> how can this info be dynamically passed to the php backend for<br>
> authentication to occur there (by looking up in a database for example)?<br>
><br>
> i cant be updating the config file everytime a new user is added that can be<br>
> crazy especially if there are thousands or more users<br>
><br>
> Regards<br>
><br>
> edit: i google and found this old email conversation on nginx mailinglist<br>
> <a href="http://markmail.org/message/tl7h2fclizgptwnr#query:NGINX%20PHP%20AUTHENTICATION+page:1+mid:f3xw2gjllat6urff+state:results" target="_blank">http://markmail.org/message/tl7h2fclizgptwnr#query:NGINX%20PHP%20AUTHENTICATION+page:1+mid:f3xw2gjllat6urff+state:results</a><br>
<br>
</div>I do not understand your problem.<br>
nginx passes client's user:pass in Authorization header transparently.<br>
<div class="im"><br>
> 2009/7/23 Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>><br>
><br>
> > On Thu, Jul 23, 2009 at 10:50:12AM +0100, nginx.mailinglist wrote:<br>
> ><br>
> > > Hello<br>
> > > just a quick question<br>
> > ><br>
> > > in lighttpd i was able to pass the username and pass from the url to php<br>
> > > backend<br>
> > ><br>
> > > but nothing happens in nginx?<br>
> > ><br>
> > > let me explain<br>
> > ><br>
> > ><br>
> > > lets say you have a URL like this<br>
> > ><br>
> > > <a href="http://userX:passY@example.com/bleh.php" target="_blank">http://userX:passY@example.com/bleh.php</a><br>
> > ><br>
> > ><br>
> > > i expect my php backend to have user and pass entries in the $_SERVER<br>
> > > variable as happens with lighttpd<br>
> > ><br>
> > > am i missing something with nginx? is it even possible?<br>
> ><br>
> > $echo userX:passY | perl -MMIME::Base64 -lne 'print encode_base64 $_'<br>
> > dXNlclg6cGFzc1k=<br>
> ><br>
> > proxy_pass <a href="http://example.com/bleh.php" target="_blank">http://example.com/bleh.php</a>;<br>
> > proxy_set_header Authorization "Basic dXNlclg6cGFzc1k=";<br>
> ><br>
> ><br>
> > --<br>
> > Igor Sysoev<br>
> > <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
> ><br>
> ><br>
<br>
</div>--<br>
<div><div></div><div class="h5">Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</div></div></blockquote></div><br></div>