Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Oct 232011

Debug Nginx configuration using the echo module


When you want to confirm you have configured Nginx correctly, e.g. make sure you have the right rewrite rules. The easiest way is to use the echo module to debug.


location / {
    rewrite ^/foo /bar break;
    echo $uri; # try with other variables you want to trace

When you use curl to request the page, you should receive something like:

# curl

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>