特定的URL - 使用位置,重写和别名重写Nginx

时间:2012-06-11 21:00:09

标签: url-rewriting nginx location

我是Nginx的初学者,我有一个特定网址重写的问题。

我希望“http://myserver.fr/context/[xxxxxxxxxxx]/synchronize.php”重定向到/space/www/synchronize.php

我想要另一个网址类型“http://myserver.php/context/ [xxxxxxxx]”重定向到/space/www/index.php

所以我认为Nginx的正确配置是:

   location /context/ {
            alias /space/www/;
            rewrite ^(.*).synchronize.php /synchronize.php last;
            rewrite ^/(.*)$ /index.php last;
     }

由于我是Nginx的初学者,你能否告诉我我的想法是否合乎逻辑?非常感谢。

0 个答案:

没有答案
相关问题