Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
    location /(0-9)* {

            #rewrite  ^/(0-9)*$  /disp\.cgi?$1 last;
            rewrite  ^(.*)$  /disp\.cgi?$1  break;
            #include proxy.conf;


Hi I'm trying to rewrite (0-9)* and pass it to thttpd. But all I get is a 404 error: If i Enter I get URL '/123' was not found on thttpd Any suggestions? thanks!

share|improve this question

the following syntax should work

location  / {

            rewrite  ^/([0-9]*)$  /disp.cgi?$1  break;
            #include proxy.conf;


If / should ne rewritten to another URL add this as well:

location = / {

share|improve this answer

Your Answer


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.