Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 37476 invoked from network); 7 Jan 2011 04:55:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jan 2011 04:55:12 -0000 Received: (qmail 57902 invoked by uid 500); 7 Jan 2011 04:55:09 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 57652 invoked by uid 500); 7 Jan 2011 04:55:08 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 57636 invoked by uid 99); 7 Jan 2011 04:55:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jan 2011 04:55:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [133.30.17.172] (HELO akiakane.center.kobe-u.ac.jp) (133.30.17.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jan 2011 04:54:58 +0000 Received: from (unknown [133.30.17.172]) by kobemaimai.kobe-u.ac.jp with smtp id 5d85_97ad_291349f0_1a1a_11e0_ad58_000423e7395a; Fri, 07 Jan 2011 13:54:09 +0900 Received: from beniitotonbo.center.kobe-u.ac.jp (beniitotonbo [133.30.16.42]) by akiakane.center.kobe-u.ac.jp (Postfix) with ESMTP id 8886B10E0339 for ; Fri, 7 Jan 2011 13:54:34 +0900 (JST) Received: from (unknown [133.30.16.42]) by kobemaimai.kobe-u.ac.jp with smtp id 5d6c_4a98_28af7254_1a1a_11e0_aba3_000423e7395a; Fri, 07 Jan 2011 13:54:06 +0900 Received: from [133.30.246.57] (unknown [133.30.246.57]) by beniitotonbo.center.kobe-u.ac.jp (Postfix) with ESMTPSA id 6694810FD16 for ; Fri, 7 Jan 2011 13:54:34 +0900 (JST) Message-ID: <4D269C8A.7010603@pearl.kobe-u.ac.jp> Date: Fri, 07 Jan 2011 13:54:34 +0900 From: Gabor Pinter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: url prefixes behind proxy References: <4D25A160.3020005@pearl.kobe-u.ac.jp> <4D25A420.1010302@pidster.com> <4D261A25.5050207@pearl.kobe-u.ac.jp> <4D2632CD.2090501@christopherschultz.net> In-Reply-To: <4D2632CD.2090501@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dear Christopher, Thank you for your reply. >> Tomcat is version 6.0 > > 6.0.what? We're just dying to know. Sorry, it's 6.0.29 . (Though at my level, the third digit may be of minor importance :) > http://localhost:8080/tom -> path/to/tomcat/webapps/tom >> http://localhost:80/tom/ -> path/to/tomcat/webapps/ > > My example above is better because it will actually work. I can see that. But doesn't this mean that you need to add a proxy_pass for each app you deploy under webapp? Plus the root app in Tomcat also needed to be moved from "/". I can live with that, I'm just curious if it is possible to use a global prefix ('/tom' is a bad example, say '/servlet') for a redirection. http://localhost:8080/servlet/ --> path/to/tomcat/webapps/ >> nginx --> apache --> django >> setup on the server (working just fine). > > Aah, unnecessary complexity: I just love it. The concept is from an Apress django book. Would you live nginx out? Or Apache? Or django? I'm open to any suggestions. Gabor On 2011-01-07 06:23, Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Gabor, > > On 1/6/2011 2:38 PM, gabor wrote: >> Tomcat is version 6.0, but it is highly experimental under my hands ;-) > > 6.0.what? We're just dying to know. > >>> 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/ . > > No, you want to access the "tom" webapp through URL > http://localhost:80/tom/. > >> Say, to change the textbook example: >> http://localhost:8080/ -> path/to/tomcat/webapps/ > > Unless you have butchered your configuration, the above path > (path/to/tomcat/webapps/) does not contain a webapp. Instead, it > contains directories where webapps live. Can you try this instead: > > http://localhost:8080/tom -> path/to/tomcat/webapps/tom > >> to: >> http://localhost:80/tom/ -> path/to/tomcat/webapps/ > > My example above is better because it will actually work. > >> 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) > > So... do you want URLs of the form /not_tom/whatever.jpg to be > redirected to your /tom context, or are you saying that NginX should > send those requests elsewhere and so Tomcat doesn't care about them? > >> I'm thinking to use a prefix to redirect because >> - I am going to have only port 80 open for the public > > Not really relevant, but understandable. > >> - there are also some static (+a few php) pages > > Also not a problem: all of this can be handled with NginX by only > mapping appropriate requests to Tomcat, regardless of their URL prefix. > >> (would be great just leave them as they are now) >> - there is also an >> nginx --> apache --> django >> setup on the server (working just fine). > > Aah, unnecessary complexity: I just love it. > >> Django serves from behind a prefix, that's why I thought to approach >> Tomcat in a similar fashion. > > Fine. Just deploy your webapp as /tom and be done with it. It will work > exactly as you'd like it to. It's the simplest possible thing you could > do, and it meets your needs. > >> Well, basically I use the default server.xml. >> Only the tag is hacked as described above. > > Undo that and go back to default server.xml. Then, put your "tom" webapp > under path/to/tomcat/webapps/tom. Restart Tomcat and everything should > work as desired. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk0mMs0ACgkQ9CaO5/Lv0PC4BACeKfmpx57LRtGeLzp8W1uCwIsw > ToAAoJtw88ZWxerVDLEWq8OhflGxyIl9 > =Pg4c > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org