<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<font class="Apple-style-span" face="Tahoma" size="2">> Date: Tue, 25 Oct 2011 19:33:15 +0100</font><br><div style="font-family: Tahoma; font-size: 10pt; ">> From: appa@perusio.net<br>> To: nginx@nginx.org<br>> Subject: Re: rewrite don't work in a multilanguage MVC site<br>> <br>> On 25 Out 2011 19h17 WEST, olfativo@hotmail.com wrote:<br>> <br>> ><br>> > Tried, and same results, redirect OK but 404 response. <br>> > Thanks!!<br>> <br>> Show your complete config. <br>> <br>> --- appa<br>> <br><br></div><div style="font-family: Tahoma; font-size: 10pt; ">Here we go. Those includes are the standard locations por PHP-FPM and static content:</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="Tahoma" size="2">map $http_accept_language $is_english {</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>default 0;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>~^en 1;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2">}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">map $http_accept_language $is_spanish {</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>default 0;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>~^es 1;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2">}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">server </font></div><div><font class="Apple-style-span" face="Tahoma" size="2">{</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>listen 80;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>server_name localhost;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>root blah/blah;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>location / {</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>auth_basic "Restricted";</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>auth_basic_user_file htpasswd;</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Tahoma" size="2"> </font></span></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>index index.php index.html; </font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>expires 30d;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>if ($is_english) {</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>return 301 /en; </font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>if ($is_spanish) {</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>return 301 /es;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>location /es {}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>location /en {}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>try_files $uri $uri/ /index.php?ctr=$uri;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>}</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>include /usr/local/nginx/conf/staticfiles.conf;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>include /usr/local/nginx/conf/php.conf;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>include /usr/local/nginx/conf/drop.conf;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2">}</font></div><div style="font-family: Tahoma; font-size: 10pt; "><br></div></div> </div></body>
</html>