<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Finally using nginx&#039;s &quot;try_files&quot; directive</title>
	<atom:link href="http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/</link>
	<description>&#34;Sometimes I don&#039;t know why I even fucking try&#34;</description>
	<lastBuildDate>Thu, 29 Jul 2010 04:41:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ben</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-17034</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 06 May 2010 03:20:53 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-17034</guid>
		<description>Thank you so much for this, it took me ages to find that I had to add &amp;$args, something none of the other examples on other websites have shown, there are a few small things such as the theme preview in the WordPress admin that require this in order to work.</description>
		<content:encoded><![CDATA[<p>Thank you so much for this, it took me ages to find that I had to add &amp;$args, something none of the other examples on other websites have shown, there are a few small things such as the theme preview in the WordPress admin that require this in order to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: makuchaku</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-16827</link>
		<dc:creator>makuchaku</dc:creator>
		<pubDate>Mon, 19 Apr 2010 05:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-16827</guid>
		<description>OMG! Can&#039;t tell you that how many people you have saved from going insane :D
Thanks for your post - just what&#039;s needed :)</description>
		<content:encoded><![CDATA[<p>OMG! Can't tell you that how many people you have saved from going insane <img src='http://michaelshadle.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Thanks for your post - just what's needed <img src='http://michaelshadle.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Marschall</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-16414</link>
		<dc:creator>Matthias Marschall</dc:creator>
		<pubDate>Thu, 11 Mar 2010 10:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-16414</guid>
		<description>We&#039;re using the permalink settings by wordpress. An article gets an URL like: www.agileweboperations.com/20-devops-guys. I cannot make it work: 

The try_files approach works for the homepage and the backoffice (/wp-admin), but not for the pretty permalink urls.

The !-e approach works for home and permalinks but does not recognize /wp-admin as an existing directory and tries to redirect, too, which fails.

Anyone experienced similar issues? If it helps I can post my full nginx.conf of course...</description>
		<content:encoded><![CDATA[<p>We're using the permalink settings by wordpress. An article gets an URL like: <a href="http://www.agileweboperations.com/20-devops-guys" rel="nofollow">http://www.agileweboperations.com/20-devops-guys</a>. I cannot make it work: </p>
<p>The try_files approach works for the homepage and the backoffice (/wp-admin), but not for the pretty permalink urls.</p>
<p>The !-e approach works for home and permalinks but does not recognize /wp-admin as an existing directory and tries to redirect, too, which fails.</p>
<p>Anyone experienced similar issues? If it helps I can post my full nginx.conf of course...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason wagner</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-14439</link>
		<dc:creator>jason wagner</dc:creator>
		<pubDate>Mon, 05 Oct 2009 19:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-14439</guid>
		<description>Thank you!! The try_files line worked perfect for me.

&lt;pre class=&quot;brush: plain&quot;&gt;
location /blog/ {
   try_files $uri $uri/ /blog/index.php?q=$uri;
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thank you!! The try_files line worked perfect for me.</p>
<pre class="brush: plain">
location /blog/ {
   try_files $uri $uri/ /blog/index.php?q=$uri;
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-13391</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Fri, 17 Jul 2009 16:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-13391</guid>
		<description>you are right. just a habit i suppose. might be interesting to look at the internals though, forcing the &quot;q&quot; parameter might cut down on some processing overhead (or vice-versa)

i need to look into trying to submit a patch to drupal to get them to handle the stuff with a / prefix being ignored. or ask someone. it must be a simple fix.</description>
		<content:encoded><![CDATA[<p>you are right. just a habit i suppose. might be interesting to look at the internals though, forcing the "q" parameter might cut down on some processing overhead (or vice-versa)</p>
<p>i need to look into trying to submit a patch to drupal to get them to handle the stuff with a / prefix being ignored. or ask someone. it must be a simple fix.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-13389</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Fri, 17 Jul 2009 15:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-13389</guid>
		<description>Or, if you prefer try_files:

&lt;pre class=&quot;brush: plain&quot;&gt;
try_files $uri $uri/ /wordpress/index.php;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Or, if you prefer try_files:</p>
<pre class="brush: plain">
try_files $uri $uri/ /wordpress/index.php;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-13388</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Fri, 17 Jul 2009 15:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-13388</guid>
		<description>Why are you adding the ?q= stuff? It&#039;s not necessary in the slightest.

&lt;pre class=&quot;brush: plain&quot;&gt;
if (!-e $request_filename) {
   rewrite ^ /index.php last;
}
&lt;/pre&gt;

Done. WordPress handles parsing the URL internally, all you have to do is force index.php to load. That&#039;s it.</description>
		<content:encoded><![CDATA[<p>Why are you adding the ?q= stuff? It's not necessary in the slightest.</p>
<pre class="brush: plain">
if (!-e $request_filename) {
   rewrite ^ /index.php last;
}
</pre>
<p>Done. WordPress handles parsing the URL internally, all you have to do is force index.php to load. That's it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-13373</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Wed, 15 Jul 2009 16:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-13373</guid>
		<description>I will issue a statement of caution - with Drupal, it will work, but depending on the plugins and modules you use it might break. This is something I need to draft up in a bug or something.

I used to be able to have just:
&lt;pre class=&quot;brush: plain&quot;&gt;
try_files $uri $uri/ /index.php?q=$uri&amp;$args;
&lt;/pre&gt;

However, $uri winds up inheriting a &quot;/&quot; at the beginning which breaks certain code. WordPress handles it just fine. Drupal can too, probably with a very simple line of code in how it parses URIs. For now this appears to be the safest bet:

&lt;pre class=&quot;brush: plain&quot;&gt;
if (!-e $request_filename) {
   rewrite ^/(.*)$ /index.php?q=$1 last;
}
&lt;/pre&gt;

Note: Drupal also hosts some stuff people shouldn&#039;t be accessing in the webroot (ugh) so marking those in a block as &quot;internal&quot; will keep people from accessing them. I still haven&#039;t validated that rule yet (I am just starting to support Drupal) but I always maintain my &quot;do it in the simplest possible way&quot; rule. A lot of the examples out there look like a mess and can probably be done a hell of a lot cleaner.</description>
		<content:encoded><![CDATA[<p>I will issue a statement of caution - with Drupal, it will work, but depending on the plugins and modules you use it might break. This is something I need to draft up in a bug or something.</p>
<p>I used to be able to have just:</p>
<pre class="brush: plain">
try_files $uri $uri/ /index.php?q=$uri&$args;
</pre>
<p>However, $uri winds up inheriting a "/" at the beginning which breaks certain code. WordPress handles it just fine. Drupal can too, probably with a very simple line of code in how it parses URIs. For now this appears to be the safest bet:</p>
<pre class="brush: plain">
if (!-e $request_filename) {
   rewrite ^/(.*)$ /index.php?q=$1 last;
}
</pre>
<p>Note: Drupal also hosts some stuff people shouldn't be accessing in the webroot (ugh) so marking those in a block as "internal" will keep people from accessing them. I still haven't validated that rule yet (I am just starting to support Drupal) but I always maintain my "do it in the simplest possible way" rule. A lot of the examples out there look like a mess and can probably be done a hell of a lot cleaner.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lury</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-13371</link>
		<dc:creator>lury</dc:creator>
		<pubDate>Wed, 15 Jul 2009 11:43:02 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-13371</guid>
		<description>Thank you!

this fixed redirect loop problem with drupal, nginx and imagecache...
but i have no idea how.</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
<p>this fixed redirect loop problem with drupal, nginx and imagecache...<br />
but i have no idea how.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive/comment-page-1/#comment-12976</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 11 Jun 2009 23:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshadle.com/?p=155#comment-12976</guid>
		<description>That does not look right at all. That&#039;s setting the root to be the root of your filesystem?</description>
		<content:encoded><![CDATA[<p>That does not look right at all. That's setting the root to be the root of your filesystem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
