upstream apache { server 127.0.0.1:8080; } server{ location ~* ^/service/(.*)$ { proxy_pass http://apache/$1; proxy_redirect off; } }
worked with adding $request_uri proxy_pass http://apache/$request_uri;