rewrite rules debugging: how?

Boris Barzitz bartzitz at gmail.com
Thu Feb 22 20:34:28 MSK 2007


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.

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;
}

thanks,

Boris





More information about the nginx mailing list