From the proxy_pass documentation:
In a special case, variables are used in the proxy_pass statement: the requested URL is not used, and you are solely responsible for creating the destination URL yourself.
Since you use $ 1 for the purpose, nginx relies on you to tell you exactly what to pass. You can fix this in two ways. Firstly, stripping the start of uri with a proxy byte is trivial:
location /service/ {
Or, if you want to use the regex location, just include args:
location ~* ^/service/(.*) { proxy_pass http://apache/$1$is_args$args; }
kolbyjack Nov 15 '11 at 2:44 2011-11-15 02:44
source share