0
    location /(0-9)* {

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

            proxy_pass  http://127.0.0.1:8999;
    }

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

johnny
  • 1
  • 1

1 Answers1

2

the following syntax should work

location  / {

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

            proxy_pass  http://127.0.0.1:8999;
    }

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

location = / {

            proxy_pass  http://127.0.0.1:8999/;
    }
jcfrei
  • 175
  • 1
  • 7