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