Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a bunch of rewrite rules that I have to port from apache to nginx.

It's a rather painful process because I'm not able to see if my rewrite rules and "if" conditions are working as I want them to.

Apache did have debugging for its rewrite module. Whats can I do for nginx?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

Enable rewrite_log:

rewrite_log on;

and set debug level in error_log directive:

error_log /var/log/nginx/localhost.error_log notice;
share|improve this answer
    
so close to Apache ;) I definitely have to take a look at nginx –  Olivier Pons Nov 21 '11 at 9:40

Enable debugging support, then set debug level in error_log.

error_log   /var/log/nginx/error.log debug;

Now you can tail the log and send your requests through. There's probably more detail than you want, but that can sometimes be a lifesaver.

Oh, and you should be aware that if is evil, in a location context at least...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.