Welcome! Log In Create A New Profile

Advanced

server level url rewrite & config rewrite or internal redirection cycle

et
December 05, 2009 04:33AM
Hi,

I am using "nginx version: nginx/0.7.64", the latest stable version.
I notice that rewrite on the server level won't respect the 'break' or 'last' flag. Is this a feature or a bug? According to the module doc, it should be a bug.

[code]
server {
listen 80;
server_name hellogrow.corp.yahoo.com;
root /home/test;

error_log logs/host.error.log notice;
rewrite_log on;

rewrite ^/favicon.ico(\?.*|)$ /frontend/template/default/img/favicon.ico break;
rewrite ^/img/(.*\.(jpg|png|gif))$ /frontend/template/default/img/$1 break;
rewrite ^/js/(.*\.js)$ /frontend/template/default/js/$1 break;
rewrite ^/b_js/(.*\.js)$ /bframe/frontend/cache/js_cache/$1 break;
rewrite ^/css/(.*\.css)$ /frontend/template/default/css/$1 break;
rewrite ^/html/(.*)$ /frontend/html/$1 break;
}
[/code]


rewrite_log:
[code]
2009/12/05 17:15:08 [notice] 1352#0: *1 "^/favicon.ico(\?.*|)$" does not match "/img/fdsf.gif", client: 10.80.20.11, server: hellogrow.corp.yahoo.com, request: "GET /img/fdsf.gif?fdskaf=dkfksk HTTP/1.1", host: "hellogrow.corp.yahoo.com"
2009/12/05 17:15:08 [notice] 1352#0: *1 "^/img/(.*\.(jpg|png|gif))$" matches "/img/fdsf.gif", client: 10.80.20.11, server: hellogrow.corp.yahoo.com, request: "GET /img/fdsf.gif?fdskaf=dkfksk HTTP/1.1", host: "hellogrow.corp.yahoo.com"
2009/12/05 17:15:08 [notice] 1352#0: *1 rewritten data: "[b]/frontend/template/default/img/fdsf.gif[/b]", args: "fdskaf=dkfksk", client: 10.80.20.11, server: hellogrow.corp.yahoo.com, request: "GET /img/fdsf.gif?fdskaf=dkfksk HTTP/1.1", host: "hellogrow.corp.yahoo.com"
2009/12/05 17:15:08 [notice] 1352#0: *1 "^/favicon.ico(\?.*|)$" does not match "/frontend/template/default/img/fdsf.gif", client: 10.80.20.11, server: hellogrow.corp.yahoo.com, request: "GET /img/fdsf.gif?fdskaf=dkfksk HTTP/1.1", host: "hellogrow.corp.yahoo.com"
...
[/code]



Another question is that if there's a hidden config directive that controls the cycle numbers of internal redirection or rewrite since this cycle can be used to mimic the [b]'next|N'[/b] flag in Apache rewrite module.

Thanks,
-ET
Subject Author Posted

server level url rewrite & config rewrite or internal redirection cycle

et December 05, 2009 04:33AM

Re: server level url rewrite & config rewrite or internal redirection cycle

et December 06, 2009 03:43AM

Re: server level url rewrite & config rewrite or internal redirection cycle

Igor Sysoev December 06, 2009 04:08AM

Re: server level url rewrite & config rewrite or internal redirection cycle

Igor Sysoev December 06, 2009 04:28AM

Re: server level url rewrite & config rewrite or internal redirection cycle

et December 06, 2009 10:58AM

Re: server level url rewrite & config rewrite or internal redirection cycle

Igor Sysoev December 06, 2009 02:48PM

Re: server level url rewrite & config rewrite or internal redirection cycle

et December 06, 2009 10:58PM

Re: server level url rewrite & config rewrite or internal redirection cycle

Igor Sysoev December 07, 2009 03:04AM

Re: server level url rewrite & config rewrite or internal redirection cycle

et December 07, 2009 09:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 101
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready