<div>Why don&#39;t you put&nbsp;</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">&nbsp;location ~ \.php$ {<br>&nbsp;&nbsp; &nbsp;fastcgi_pass &nbsp; &nbsp;php-fcgi-pool;</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; ">&nbsp;}</span><br class="webkit-block-placeholder"></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br class="webkit-block-placeholder">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">before &quot;location /&quot; so that it can match first?</span></div><div><br class="webkit-block-placeholder"></div><div>Kupo</div><br>
<div class="gmail_quote">On Feb 10, 2008 1:51 AM, Mike Javorski &lt;<a href="mailto:mike.javorski@gmail.com">mike.javorski@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks Denis. The problem w/ your solution is there is lots of<br>directories. I don&#39;t want to have to create entries for each. I<br>suppose I could to a regex for .*/$ but some of the directories have<br>index.html instead of index.php, and I need to support that as well<br>
:-(.<br><br>Any other options/suggestions?<br><font color="#888888"><br>- mike<br></font><div><div></div><div class="Wj3C7c"><br>On Feb 9, 2008 10:42 PM, Denis F. Latypoff &lt;<a href="mailto:denis@gostats.ru">denis@gostats.ru</a>&gt; wrote:<br>
&gt; Hello Mike,<br>&gt;<br>&gt;<br>&gt; Sunday, February 10, 2008, 12:32:14 PM, you wrote:<br>&gt;<br>&gt; &gt; I have nginx set up as a load balancer in front of two machines<br>&gt; &gt; running fastcgi/php, and nginx for static content. The desired goal is<br>
&gt; &gt; to have all php pages (including the site index pages of .*/index.php)<br>&gt; &gt; processed by the fastcgi/php upstream, and everything else provided by<br>&gt; &gt; the static servers. The following is what I have and what I believe<br>
&gt; &gt; should have worked, but it appears to run all directory paths via the<br>&gt; &gt; static rule, rather than the php rule which matches the index.<br>&gt;<br>&gt; &gt; To sum up:<br>&gt; &gt; / -- via static system (WRONG)<br>
&gt; &gt; /index.php -- via fastcgi/php system (RIGHT)<br>&gt; &gt; /blah/ -- via static system (WRONG)<br>&gt; &gt; /blah/index.php -- via fastcgi/php system (RIGHT)<br>&gt;<br>&gt; &gt; nginx version is 0.6.25, Help! :-)<br>
&gt;<br>&gt; &gt; tia,<br>&gt;<br>&gt; &gt; - mike<br>&gt;<br>&gt; &gt; My Config File (the relevent bits anyway):<br>&gt; &gt; ---------------------------------------------------<br>&gt;<br>&gt; &gt; http {<br>&gt; &gt; &nbsp; &nbsp; upstream &nbsp;static-pool {<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; server &nbsp;<a href="http://192.168.7.40:80" target="_blank">192.168.7.40:80</a>;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; server &nbsp;<a href="http://192.168.7.41:80" target="_blank">192.168.7.41:80</a>;<br>&gt; &gt; &nbsp; &nbsp; }<br>&gt;<br>
&gt; &gt; &nbsp; &nbsp; upstream php-fcgi-pool {<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; server &nbsp;<a href="http://192.168.7.40:7000" target="_blank">192.168.7.40:7000</a>;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; server &nbsp;<a href="http://192.168.7.41:7000" target="_blank">192.168.7.41:7000</a>;<br>
&gt; &gt; &nbsp; &nbsp; }<br>&gt;<br>&gt; &gt; &nbsp; &nbsp; server {<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; listen &nbsp;80;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; &nbsp;/website/htdocs;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; index &nbsp; index.php;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_index &nbsp; index.php;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; include &nbsp; &nbsp; /etc/nginx/fastcgi_params;<br>
&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; location / {<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass <a href="http://static-pool/website/htdocs/" target="_blank">http://static-pool/website/htdocs/</a>;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt;<br>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; location = / {<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass &nbsp; &nbsp;php-fcgi-pool;<br>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt;<br>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; location = /blah/ {<br>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass &nbsp; &nbsp;php-fcgi-pool;<br>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt;<br>&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; location ~ \.php$ {<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass &nbsp; &nbsp;php-fcgi-pool;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt; &gt; &nbsp; &nbsp; }<br>&gt; &gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Best regards,<br>&gt; &nbsp;Denis &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mailto:<a href="mailto:denis@gostats.ru">denis@gostats.ru</a><br>
&gt;<br>&gt;<br>&gt;<br><br></div></div></blockquote></div><br>