server level url rewrite & config rewrite or internal redirection cycle

Igor Sysoev igor at sysoev.ru
Mon Dec 7 10:59:51 MSK 2009


On Sun, Dec 06, 2009 at 10:58:49PM -0500, et wrote:

> Thanks Igor.
> 
> You can say it's over-engineering. But make the cycle number controlled by the user should be reasonable and a trivial work.
> 
> I also suggest to mention in the doc of rewrite module that the 'break'/'last' flag not supported on the server level config.

Yes, rewrite module was not well-though-out from the very start, since
I never considered it as a normal configuration method. Why not to configure
in clean and nice way:

     location / {
         fastcgi_pass  127.0.0.1:9000;
         fastcgi_param SCRIPT_FILENAME  /home/test/common.php;
         include       fastcgi_params;
     }

     location = /common.php {
         retrun 404;
     }

     location = /favicon.ico {
         root  /home/test/frontend/template/default/img;
     }

     location  /img/ {
         root  /home/test/frontend/template/default;
     }

     location  /js/ {
         root  /home/test/frontend/template/default;
     }

     location  /b_js/ {
         alias /home/test/bframe/frontend/cache/js_cache/;
     }

     location  /css/ {
         root  /home/test/frontend/template/default;
     }

     location  /html/ {
         root  /home/test/frontend/;
     }


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list