I use this for the Symfony framework:
location / {
# Rule for static files
if (-f $request_filename) {
# Set the expires header
# expires 3h;
break;
}
rewrite ^(.*) /index.php last;
}
location ~ (.*\.php)($|/) {
set $script $1;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)/?") {
set $script $1;
set $path_info $2;
}
if ($server_port = 80) {
set $https_enabled off;
}
if ($server_port = 443) {
set $https_enabled on;
}
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param HTTPS $https_enabled;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_pass_header Set-Cookie;
}
nginx-bounces@nginx.org wrote on 22/12/2011 10:46:46:
> From: "escavern" <nginx-forum@nginx.us>
> To: nginx@nginx.org
> Date: 22/12/2011 10:46
> Subject: Need this htaccess url rewrite to Nginx rewrite
> Sent by: nginx-bounces@nginx.org
>
> Helo my friends,
>
> i have problem converting this .htaccess url rewrite to Nginx rewrite
> rule,,
>
----------------------------------------------------------------------------------------------------------
> RewriteEngine on
> RewriteRule ^(index\.php)?([a-z0-9]+)$ index.php?$2 [L]
>
----------------------------------------------------------------------------------------------------------
>
> any help will be appreciate ;-).
> Thanks
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220385,
> 220385#msg-220385
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx