Welcome! Log In Create A New Profile

Advanced

Re: Rewriting and proxy problem

Francis Daly
May 27, 2013 03:18PM
On Mon, May 27, 2013 at 11:31:37AM -0300, Sergio Belkin wrote:

Hi there,

> I'd want that when you type http://example.com/upvc 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 http://127.0.0.1:8080/demo/demo3.jsp

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
http://nginx.org/r/proxy_pass

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

location = /upvc {
rewrite ^ /demo/demo3.jsp break;
proxy_pass http://127.0.0.1:8080;
}

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.

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewriting and proxy problem

Sergio Belkin May 24, 2013 01:42PM

Re: Rewriting and proxy problem

B.R. May 24, 2013 03:08PM

Re: Rewriting and proxy problem

Francis Daly May 25, 2013 05:28AM

Re: Rewriting and proxy problem

Sergio Belkin May 27, 2013 10:34AM

Re: Rewriting and proxy problem

Sergio Belkin May 27, 2013 10:46AM

Re: Rewriting and proxy problem

Francis Daly May 27, 2013 03:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready