On 1/6/2011 8:14 PM, Pid wrote:
On 1/6/11 11:02 AM, Gabor Pinter wrote:
Dear list,

I have a very trivial problem.

My setup:
CentOS 5.5
nginx 0.8.53
Tomcat6
You're using the unreleased, but highly experimental and potentially
dangerous version 6.3.7!?

;)
First, thank you for your reply.

Tomcat is version 6.0, but it is highly experimental under my hands ;-)


net --->  nginx:80 (proxy_pass) --->  tomcat:8080

Proxy redirect is triggered by prefix "/tom/"

myhost:80/tom/<url>   --->   127.0.0.1:8080/tom/<url>

Now here is my question.
How can I let Tomcat know about this "/tom/" prefix?
What do you expect Tomcat to do with the prefix?

You have configured* the proxy to expect Tomcat to have either tom.war
or a directory deployed in tomcat/webapps called 'tom'.

e.g
  path/to/tomcat/webapps/tom.war

or
  path/to/tomcat/webapps/tom/

Oh, I'm sorry not to say that.
I would like to access Tomcat root through url http://localhost:80/tom/ .
Say, to change the textbook example:
http://localhost:8080/     ->   path/to/tomcat/webapps/
to:
http://localhost:80/tom/     ->   path/to/tomcat/webapps/

Probably the more difficult part is when a webapp publishes a link,
(e.g., to a .jpg) without the prefix /tom/  -> which in turn is not proxy
redirected by nginx to Tomcat... (404.htm)

I'm thinking to use a prefix to redirect because
- I am going to have only port 80 open for the public
- there are also some static (+a few php) pages
(would be great just leave them as they are now)
- there is also an
nginx --> apache --> django
setup on the server (working just fine).

Django serves from behind a prefix, that's why I thought to approach Tomcat in a similar fashion.

<Host name="localhost/tom" ...  seems to work in a somewhat confusing
manner
"localhost/tom" isn't valid hostname, nothing surprising about that.
My first surprise was, that it worked at all...

p

* Assuming a default server.xml - you didn't say...

Well, basically I use the default server.xml.
Only the <Host> tag is hacked as described above.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to