rewrite rules debugging: how?

Igor Sysoev is at rambler-co.ru
Thu Feb 22 20:39:24 MSK 2007


On Thu, Feb 22, 2007 at 07:34:28PM +0200, Boris Barzitz wrote:

> hello,
> 
> i'm migrating a site from apache and having problems with rewrite rules (i 
> guess). how do i debug them? i've heard that nginx should write some debug 
> info to the error log, but i can't make it to. which options should i use 
> to switch on the debugging?
> 
> error_log  /var/log/file.log debug; doesn't output any debug info.

error_log    /var/log/file.log notice;

http {
     rewrite_log  on;

> here's my vhost config:
> 
> server {
>     listen          80;
>     server_name     contactbles.com www.contactbles.com;
>     index           index.html index.php;
> 
>     access_log      /var/log/nginx/contactbles-access.log;
>     error_log       /var/log/nginx/contactbles-error.log debug;
> 
>     client_max_body_size 2M;
> 
>     root   /home/contactbles/public_html;
> 
>     if (!-f $request_filename) {
> 	rewrite ^/$ php/index.php last;
> 	rewrite ^/fonts/(\d)\.html$                     
> 	/php/fontlist.php?page=$1 last;
> 	rewrite ^/backgrounds/(\d+)\.html$              
> 	/php/bglist.php?page=$1 last;
> 	rewrite ^/backgrounds/([0-9]+)/(\d+)\.html$     
> 	/php/bglist.php?category=$1&page=$2 last;
> 	rewrite ^/tables/(\d+)\.html$                   
> 	/php/tables.php?page=$1 last;
> 	rewrite ^/tables/([0-9]+)/(\d+)\.html$          
> 	/php/tables.php?category=$1&page=$2 last;
> 	rewrite ^/(.+)\.html$ php/$1.php last;
>     }
> 
>     include /etc/nginx/fcgi.conf;
> }


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





More information about the nginx mailing list