Rewriting and proxy problem

Francis Daly francis at
Mon May 27 19:16:49 UTC 2013

On Mon, May 27, 2013 at 11:31:37AM -0300, Sergio Belkin wrote:

Hi there,

> I'd want that when you type proxies the
> /var/lib/tomcat6/webapps/demo/
> demo3.jsp file  to tomcat

Just for clarity, "proxy_pass" proxies to a url, not to a file. So you
probably want it to proxy to

If I've got the mapping of url/filename wrong, adjust it as necessary.

You haven't said what any *other* requests to nginx should do, so I will
show an example for only exactly what you said.

There is not an obvious mapping from /upvc to /demo/demo3.jsp, so I
won't include any kind of generic replacement here.

You will find very useful information on all of this at

So, in the appropriate server block, you want something like:

  location = /upvc {
    rewrite ^ /demo/demo3.jsp break;

This will handle requests for /upvc and /upvc?something. The documentation
should explain why it works.

All of the other directives can be added back, when you know why they
are needed here.


Francis Daly        francis at

More information about the nginx mailing list