<?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"
	>

<channel>
	<title>YAB &#187; nginx</title>
	<atom:link href="http://blog.alexgirard.com/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexgirard.com</link>
	<description>Yet Another Blog</description>
	<pubDate>Wed, 26 Nov 2008 23:44:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>[Nginx] fastcgi configuration on Centos</title>
		<link>http://blog.alexgirard.com/nginx-fastcgi-configuration-on-centos/</link>
		<comments>http://blog.alexgirard.com/nginx-fastcgi-configuration-on-centos/#comments</comments>
		<pubDate>Tue, 20 May 2008 10:48:58 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[502]]></category>

		<category><![CDATA[bad gateway]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[configuration]]></category>

		<category><![CDATA[fastcgi]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/?p=160</guid>
		<description><![CDATA[After a week of &#8220;502 Bad Gateway&#8221; error on blog.feevy.com, it was time to dive in our new Nginx toy on Feevy server and understand what happened.
First, Nginx is not like Apache or Lighttpd, it doesn&#8217;t support FastCGI by default. So, you need to be sure you&#8217;ve compiled the fcgi module with your PHP installation.
On [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.alexgirard.com/wp-content/uploads/2008/05/nginx_small.png" alt="" title="Nginx" width="150" height="50" class="alignleft size-full wp-image-161" />After a week of &#8220;<em>502 Bad Gateway</em>&#8221; error on <a href="http://blog.feevy.com">blog.feevy.com</a>, it was time to dive in our new <a href="http://wiki.codemongers.com/Main">Nginx</a> toy on Feevy server and understand what happened.</p>
<p>First, Nginx is not like Apache or Lighttpd, it doesn&#8217;t support FastCGI by default. So, you need to be sure you&#8217;ve compiled the fcgi module with your PHP installation.</p>
<p>On Centos, to compile a new PHP, just launch: <strong><em>/scripts/easyapache</em></strong></p>
<p>Then you&#8217;ll need to launch the FastCGI process, <a href='http://blog.alexgirard.com/wp-content/uploads/2008/05/fastcgi_script.txt'>download this FastCGI script</a>, place it in /usr/local/bin, and <a href="http://www.zabbix.com/forum/showthread.php?t=3280">add it to your init.d</a>.</p>
<p>At the end, you just need to configure your php server in nginx, that would be the most simple part:</p>
<pre class="prettyprint">
  server {
      listen 80;
      server_name     blog.feevy.com;
      index           index.php;
      root            /home/wwwfeev/blog;

      if (!-e $request_filename) {
        rewrite  ^(.*)$  /index.php?q=$1  last;
        break;
      }

      location ~ \.php$ {
         fastcgi_pass  127.0.0.1:9999;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_NAME $fastcgi_script_name;
         fastcgi_param REQUEST_URI $request_uri;
         fastcgi_param DOCUMENT_URI $document_uri;
         fastcgi_param DOCUMENT_ROOT $document_root;
         fastcgi_param REMOTE_ADDR $remote_addr;
         fastcgi_param REMOTE_PORT $remote_port;
         fastcgi_param SERVER_ADDR $server_addr;
         fastcgi_param SERVER_PORT $server_port;
         fastcgi_param SERVER_NAME $server_name;
         fastcgi_param SCRIPT_FILENAME  /home/wwwfeev/blog/$fastcgi_script_name;
         fastcgi_param QUERY_STRING $query_string;
         fastcgi_param REQUEST_METHOD $request_method;
         fastcgi_param CONTENT_TYPE $content_type;
         fastcgi_param CONTENT_LENGTH $content_length;
      }
  }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/nginx-fastcgi-configuration-on-centos/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

