Igor, thanks. <br><br><div class="gmail_quote">2009/9/10 Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</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>
&gt; Hi All,<br>
&gt;<br>
&gt; My understanding is that nginx cannot be used as a forward proxy out of the<br>
&gt; box. Is this correct?<br>
&gt;<br>
&gt; If so, my thinking is that by making some small modifications to<br>
&gt; ngx_http_proxy_module.c, it would be possible to have a nginx.conf file with<br>
&gt; &quot;proxy_pass asdf&quot;, where asdf ends up being ignored with the new surgical<br>
&gt; edits to ngx_http_proxy_module.c. Instead of doing the complex lookups to<br>
&gt; figure out the backend server, it would simply pull out the &quot;Host&quot; from the<br>
&gt; browser/client request being made, and use that as the appropriate URL to<br>
&gt; fetch.<br>
&gt;<br>
&gt; Would this work?<br>
&gt;<br>
&gt; (As a background, I currently have a squid + ICAP setup in transparent proxy<br>
&gt; mode, and it works fine for proof-of-concept, but falls over in terms of<br>
&gt; performance. As a result, I&#39;m trying to use nginx as a replacement. And with<br>
&gt; the http_sub module, I&#39;m thinking I don&#39;t even need ICAP, since we only add<br>
&gt; a small snippet after the HTML head section of every web page.)<br>
&gt;<br>
&gt; If there are better / easier ways of getting nginx to work as a forward<br>
&gt; proxy, please let me know, and I&#39;d be happy to contribute the edits back.<br>
&gt;<br>
&gt; Thanks!<br>
&gt; Mark<br>
&gt;<br>
&gt; PS. If the response is in Russian, that&#39;s cool too. I can read it just fine<br>
&gt; (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>