Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8140117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:03:23+00:00 2026-06-06T12:03:23+00:00

I need to make a reverse proxy back to a tomcat server running a

  • 0

I need to make a reverse proxy back to a tomcat server running a grails application.
I have always seen reverse proxy examples like this:

ProxyRequests Off
ProxyPass / http://localhost:8080/appname/
ProxyPassReverse / http://localhost:8080/appname/
ProxyPreserveHost On

In all my apps though, when I do that the page comes up and my statics get loaded like this with the context:
/appname/static/[jsapp.js][mycss.css]

so consequently styling and functionality are lost. So my workaround is has been to do this:

ProxyRequests Off
ProxyPass /appname/ http://localhost:8080/appname/
ProxyPass / http://localhost:8080/appname/
ProxyPassReverse /appname/ http://localhost:8080/appname/
ProxyPassReverse / http://localhost:8080/appname/
ProxyPreserveHost On

which I guess is a reverse-reverse-proxy; either way it seems hacky and has (what i think is) a side affect; it creates the URL with the tomcat context in it: http://servername.com/appname/user/username instead of http://servername.com/user/username. I would much prefer the later if its possible without losing the styling.

NOTES:

  • When i go to the base URL:http://servername.com it works fine, any link i click on after that puts the “/appname/” name in the URL.
  • I believe that I could resolve this by making the app on tomcat the ROOT app, however, I would prefer not to.
  • This example is using HTTP, I normally use AJP protocol, but I tried HTTP last just for kicks
  • This is in a NameVirtualHost configuration.
  • Apache 2.2.15, Tomcat 7.0.27, CentOS release 6.2 (Final), java version “1.7.0_04”, Grails 2.0.4

Any thoughts on what I need to be doing differently?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:03:24+00:00Added an answer on June 6, 2026 at 12:03 pm

    There are several ways, how to solve this situation. I am using vhosts inside TomCat, so I eliminate the application name in the URL. Add this to your server.xml

    <Host name="myapp.com"  appBase="myappbase" unpackWARs="true" autoDeploy="false">
        <Alias>www.myapp.com</Alias>
    
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="myapp_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
    
        <Context path="/thumbnails" docBase="/var/www/myapp/thumbnails" reloadable="true">
    
    </Host>
    

    in your $TOMCAT_HOME create a directory “myappbase”, where you upload your application WAR as ROOT.war. Your application is available via http://myapp.com:8080/.

    Your proxy configuration is than very simple 😉 You can also make more vhosts in 1 TomCat.

    In the aforementioned configration is also an directory alias (thumbnails), which is accessible via http://myapp.com/thumbnails/ and you can use it in GSP via:

    ${ resource( dir: 'thumbnails', file: 'image01.png' ) }
    

    And the last point, which can help you is setting a “static” directories in UrlMappings.groovy. These directories are ignored when translation URL to controllers and vice versa:

    static excludes = [
            '/css*', '/js*', '/thumbnails*'
    ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make a proxy script that can access a page hidden behind
I need to make a cURL request to a https URL, but I have
I'm using Nginx as webserver, with a reverse proxy to a gunicorn django server.
I have decided that I really need to get some flowcharts for reverse engineering
I need to make requests to a web service via android application. The webservice
I need to make a div layer so that when you click on it
I need to make this function work everywhere, except IE6-7 $(function(){ window.scrollTo(0,300); }) Please
i need to make my window top level when i need. Code of creating
I need to make a column unique in one of our database tables, and
I need to make some changes to an old Oracle stored procedure on an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.