Nginx as Apache proxy for static content

Hello,

I installed Nginx. Set up as a server for static content and a dynamic
content to be redirected to a Apache server behind. Everything works
fine,
server load decreased. I began to serving three times more requests.
Glad
that everything worked, but the beam. Rewrite rules don’t work.
Here is my configuration of Nginx in /etc/nginx/conf.d/virtual.conf:

#virtual hosts start
#start - default
server
{
listen 80;
server_name default alias.default;

location ~* (/|.php|.phtm|.phtml)$
{
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;

 proxy_set_header Host            $host;
 proxy_set_header X-Real-IP       $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 client_max_body_size    128m;

 proxy_connect_timeout 60;
 proxy_send_timeout    60;
 proxy_read_timeout    60;

}
location /
{
root /var/www;
}
}
#end - default

#start - secretsexpartner.com
server
{
listen 80;
server_name secretsexpartner.com www.secretsexpartner.com
alias.secretsexpartner.com;

location ~* (/|.php|.phtm|.phtml)$
{
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;

 proxy_set_header Host            $host;
 proxy_set_header X-Real-IP       $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


 client_max_body_size    128m;

 proxy_connect_timeout 60;
 proxy_send_timeout    60;
 proxy_read_timeout    60;

}

location /
{
root /var//www;
}
}
#end - secretsexpartner.com
#virtual hosts end

I use following .htaccess file on apache root directory:

RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ navigation.php

RewriteRule .* - [E=HTTP_X_REQUESTED_WITH:%{HTTP:X-Requested-With}]

And when try to access web pages that use this rules, nginx tell me Page
not found 404. How to implement this .htaccess to work and with Nginx
frontend.

Thanks in advance!

try

location ~* .(php|phtm|phtml)$

or

location ~* .(php|phtm(l)?)$

2009/11/20 Genko P. [email protected]