<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phoenixheart - portfolio &#38; more &#187; nginx</title>
	<atom:link href="http://www.phoenixheart.net/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phoenixheart.net</link>
	<description>phoenixheart - portfolio &#38; more</description>
	<lastBuildDate>Wed, 23 Mar 2011 09:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<script type="text/javascript">
if (typeof Meebo == "undefined") {
Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};
(function(q){

	var args = arguments;
	if (!document.body) { return setTimeout(function(){ args.callee.apply(this, args) }, 100); }
	var d=document, b=d.body, m=b.insertBefore(d.createElement('div'), b.firstChild); s=d.createElement('script');
	m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id="meebo-iframe"></iframe>';
	s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;
	b.insertBefore(s, b.firstChild);

})({network:'phoenixheartnet_bo16we'});	}</script>	<item>
		<title>How to configure nginx to run Kohana on Ubuntu</title>
		<link>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/</link>
		<comments>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 07:20:23 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Server stuffs]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=440</guid>
		<description><![CDATA[As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve started to move away from Apache in favor of nginx (pronounced &#8220;engine-X&#8221;). It&#8217;s not that I really need its power, it&#8217;s just that I wanted to learn something new to break my box. It&#8217;s fairly simple to set up [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve started to move away from Apache in favor of <a title="nginx's homepage" href="http://nginx.org/">nginx</a> (pronounced &#8220;engine-X&#8221;). It&#8217;s not that I really need <a title="nginx compared to Apache" href="http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/">its power</a>, it&#8217;s just that I wanted to learn something new to break my box.</p>
<p>It&#8217;s fairly simple to set up and get nginx running with FastCGI and MySQL on Ubuntu &#8211; a very well-written tutorial can be read <a href="http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-ubuntu-8.10">on HowtoForge</a>, which should take you less than 15 minutes for everything. In this article therefore I will only write about how to configure nginx to actually run a <a href="http://www.kohanaphp.com/">Kohana</a>-powered site, with virtual host and rewriting and such. If you&#8217;re not familiar with Kohana, take a look at <a href="http://www.phoenixheart.net/2009/01/kohana-php-framework/">my article here</a>.</p>
<h3>The prerequisites</h3>
<ul>
<li>I have my Kohana-power site located under <code>/home/phoenixheart/www/my-kohana/</code> directory with proper permission set (owner being www-data, that is).</li>
<li>nginx has been set up properly and listening on port 80, with the configuration directory being <code>/etc/nginx/</code></li>
<li>I want my site to be locally accessible via my-kohana.dev. Any requests to www.my-kohana.dev should be permanently redirected to my-kohana.dev &#8211; which is also called &#8220;force non-www&#8221;.</li>
<li>I want to have neat URL rewriting without &#8220;index.php&#8221;, for example <code>index.php?controller=product&amp;function=get&amp;id=1</code> should be rewritten into <code>/product/get/1</code></li>
<li>I also want that all existing files and directories under the root directory are accessible, except Kohana&#8217;s system directories <code>system</code>, <code>application</code>, and <code>modules</code>. Any attempt to access system files and directories(beginning with dots, like .htaccess or .settings) should be disallowed also.</li>
</ul>
<p>All clear. So let&#8217;s do it!<br />
<span id="more-440"></span></p>
<h3>Set up the virtual host</h3>
<p>The way nginx handles virtual hosts is totally different from Apache, as we can expect. Instead of using .conf files to declare and configure the hosts, nginx, when started, additionally scans through the configuration folder (<code>/etc/nginx</code> in our case) to find (if any) configuration files under 2 directories: sites-available and sites-enabled. So under /etc/nginx/sites-available, create a file called my-kohana.dev with the following content:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen   <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
&nbsp;
    access_log <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">/</span>access<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># remember to create this file
</span>    <span style="color: #990000;">error_log</span> <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">/</span>error<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># and this file
</span>
    location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
	root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
	index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~ \<span style="color: #339933;">.</span>php$ <span style="color: #009900;">&#123;</span>
	fastcgi_pass   127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1<span style="color: #339933;">:</span><span style="color: #cc66cc;">9000</span><span style="color: #339933;">;</span>
	fastcgi_index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
	fastcgi_param  SCRIPT_FILENAME  <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #000088;">$fastcgi_script_name</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">include</span>        fastcgi_params<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Of course, this is just the basis configuration for the site to get up and running. To continue, we must create a host entry. Open /etc/hosts and add this line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1	my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev</pre></td></tr></table></div>

<p>If this was Apache, we would be good enough to restart the webserver to see the result. But like I said, nginx is different. For nginx to properly recognize and serve our site, we must <em>enable</em> the site by creating a symlink of the configuration file under <code>sites-enabled</code>. We do that as follow:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">ln <span style="color: #339933;">-</span>s <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>sites<span style="color: #339933;">-</span>available<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>sites<span style="color: #339933;">-</span>enabled<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev</pre></div></div>

<p>Now, let&#8217;s restart nginx. Open Terminal and type:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">sudo <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>nginx restart</pre></div></div>

<p>The result should be as followed:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Restarting nginx<span style="color: #339933;">:</span> the configuration <span style="color: #990000;">file</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>nginx<span style="color: #339933;">.</span>conf syntax is ok
configuration <span style="color: #990000;">file</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>nginx<span style="color: #339933;">.</span>conf test is successful
nginx<span style="color: #339933;">.</span></pre></div></div>

<p>If you receive any &#8220;failure&#8221; response, chance is some typos in the configuration.</p>
<p>Now, http://my-kohana.dev should be accessible via the browser (Note that, if Kohana complains about the logs folder inaccessible, try properly setting its owner to www-data). Next step is tweaking the configuration a bit to serve our needs.</p>
<h3>Tweak it up</h3>
<h4>Force non-www</h4>
<p>To force non-www, open sites-available/my-kohana.dev and add these lines at the top:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
    rewrite  ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$  http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//my-kohana.dev/$1  permanent;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This kind of configuration is very similar to that of Apache, so I would assume there&#8217;s no need to explain. After a nginx restart, all request to http://www.my-kohana.dev should be silently redirected to http://my-kohana.dev.</p>
<h4>Neat URL rewriting</h4>
<p>Again, in sites-available/my-kohana.dev, modify the first <code>location</code> block to the following</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
    root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
    index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>    <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>    rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>But wait! We don&#8217;t want EVERY requests to be re-written. For example, a request to my-kohana.dev/css/style.css should be kept as-is. Same goes with javascripts and images. In short, if the request is for an existing file or folder, we keep it as-is; else, we route it to index.php using rewriting. To achieve that, modify the configuration above to this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
    root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
    index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>f <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing file, break (do nothing)&quot;
</span>        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing directory, break (do nothing)&quot;
</span>        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># the request is not an existing file or directory
</span>    <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>    <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>    rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h4>Set files and folder accessibilities</h4>
<p>Now, we prohibit access to the sensitive stuffs, including kohana system folders, dot files and directories etc. It&#8217;s fairly simple with nginx. All we need to do is adding two more location blocks, specific for this purpose:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">location ~ <span style="color: #339933;">/</span>\<span style="color: #339933;">.</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># or, if you prefer
</span>    <span style="color: #666666; font-style: italic;">#return 403;
</span>    <span style="color: #666666; font-style: italic;"># or even
</span>    <span style="color: #666666; font-style: italic;">#deny all;
</span><span style="color: #009900;">&#125;</span>
location ~<span style="color: #339933;">*</span> ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>modules<span style="color: #339933;">|</span>application<span style="color: #339933;">|</span>system<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># or, if you prefer
</span>    <span style="color: #666666; font-style: italic;">#return 403;
</span>    <span style="color: #666666; font-style: italic;"># or even
</span>    <span style="color: #666666; font-style: italic;">#deny all;
</span><span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The final configuration file should look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name www<span style="color: #339933;">.</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
    rewrite  ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$  http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//my-kohana.dev/$1  permanent;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
server <span style="color: #009900;">&#123;</span>
    listen   <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    server_name my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">;</span>
&nbsp;
    access_log <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">.</span>access<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">error_log</span> <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span><span style="color: #990000;">log</span><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">.</span>dev<span style="color: #339933;">.</span>error<span style="color: #339933;">.</span><span style="color: #990000;">log</span><span style="color: #339933;">;</span>
&nbsp;
    location ~ <span style="color: #339933;">/</span>\<span style="color: #339933;">.</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">404</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
        root   <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #339933;">;</span>
        index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>f <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing file, break (do nothing)&quot;
</span>            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #000088;">$request_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;"># translated into &quot;if the request is an existing directory, break (do nothing)&quot;
</span>            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># the request is not an existing file or directory
</span>        <span style="color: #666666; font-style: italic;"># this is where the rewriting gets done.
</span>        <span style="color: #666666; font-style: italic;"># refer to http://forum.kohanaphp.com/comments.php?DiscussionID=1505 for more info
</span>        rewrite ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>index<span style="color: #339933;">.</span>php?kohana_uri<span style="color: #339933;">=</span>$<span style="color: #cc66cc;">1</span> last<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~ \<span style="color: #339933;">.</span>php$ <span style="color: #009900;">&#123;</span>
        fastcgi_pass   127<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>1<span style="color: #339933;">:</span><span style="color: #cc66cc;">9000</span><span style="color: #339933;">;</span>
        fastcgi_index  index<span style="color: #339933;">.</span>php<span style="color: #339933;">;</span>
        fastcgi_param  SCRIPT_FILENAME  <span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>phoenixheart<span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>kohana<span style="color: #000088;">$fastcgi_script_name</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">include</span>        fastcgi_params<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~<span style="color: #339933;">*</span> ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>modules<span style="color: #339933;">|</span>application<span style="color: #339933;">|</span>system<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">403</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>After another nginx restart, our Kohana instance should run without any hassles.</p>
<p>Typos? Mistakes? Errors? Let&#8217;s hear it in your comment.</p>
<img style='display:none' id="post-440-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/',title:'How to configure nginx to run Kohana on Ubuntu',tweet:'As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve st',description:'As a web developer I&#8217;ve been using Apache for a long long time. Recently though, I&#8217;ve st'})"><script type='text/javascript'>document.getElementById("post-440-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2010/03/how-to-configure-nginx-to-run-kohana-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 2/6 queries in 0.030 seconds using disk
Object Caching 232/232 objects using disk

Served from: www.phoenixheart.net @ 2012-02-04 03:11:32 -->
