Igor, thanks. <br><br><div class="gmail_quote">2009/9/10 Igor Sysoev <span dir="ltr"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Thu, Sep 10, 2009 at 02:12:55AM -0700, Mark Preston wrote:<br>
<br>
> Hi All,<br>
><br>
> My understanding is that nginx cannot be used as a forward proxy out of the<br>
> box. Is this correct?<br>
><br>
> If so, my thinking is that by making some small modifications to<br>
> ngx_http_proxy_module.c, it would be possible to have a nginx.conf file with<br>
> "proxy_pass asdf", where asdf ends up being ignored with the new surgical<br>
> edits to ngx_http_proxy_module.c. Instead of doing the complex lookups to<br>
> figure out the backend server, it would simply pull out the "Host" from the<br>
> browser/client request being made, and use that as the appropriate URL to<br>
> fetch.<br>
><br>
> Would this work?<br>
><br>
> (As a background, I currently have a squid + ICAP setup in transparent proxy<br>
> mode, and it works fine for proof-of-concept, but falls over in terms of<br>
> performance. As a result, I'm trying to use nginx as a replacement. And with<br>
> the http_sub module, I'm thinking I don't even need ICAP, since we only add<br>
> a small snippet after the HTML head section of every web page.)<br>
><br>
> If there are better / easier ways of getting nginx to work as a forward<br>
> proxy, please let me know, and I'd be happy to contribute the edits back.<br>
><br>
> Thanks!<br>
> Mark<br>
><br>
> PS. If the response is in Russian, that's cool too. I can read it just fine<br>
> (and speak it), but my writing is rather poor. :-)<br>
<br>
</div></div>Although writing in Russian is more easy for me I answer in English,<br>
since this is English mailing list.<br>
<br>
You may try the following configuration:<br>
<br>
http {<br>
<br>
resolver 127.0.0.1; # do not forget to run named on localhost<br>
<br>
server {<br>
location / {<br>
proxy_pass http://$http_host$request_line;<br>
sub ...<br>
}<br>
}<br>
<br>
However, I can not say that it will work without any issue.<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>The time you enjoy wasting is not wasted time!<br>