JSF behind a reverse proxy

I am trying to deploy a JSF application behind a reverse proxy installation, with no success. The Apache reverse proxy has the following entries in the configuration:
ProxyPass /myApp http://localhost:8080/myApp
ProxyPassReverse /myApp http://localhost:8080/myApp
The application is running on jboss listening to port 8080 and behaves very well if I connect to http://server:8080/myApp.
When I invoke http://server/myApp, the redirection is done and I receive the core HTML of the page I requested, but all URLs inside the page are not correct, pointing to localhost:8080/myApp... As you understand, after a certain point the application is completely unusable.

Any ideas how I can configure myFaces ver.1.1 to make it generate relative URLs instead of absolute ones for everything if it doing?

Thank you in advance for your help

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

upcomltdConnect With a Mentor Author Commented:
I found the solution for me in the following link:

It is enough to define the reverse proxy address in the Tomcat configuration.. It does not automatically pickup the URL the user typed, but at least it reverts it to something the user can use in the future. For example I typed: and because I had specified as proxyName="www.company.com" it immediately redirected me to http://www.company.com/myApp.
The important thing though is that it works well for all clients.
I don't think your directives are right. e.g. in ProxyPass the local path is meant to be mapped to a remote server. See

upcomltdAuthor Commented:
I use it already for other applications and it works without ANY problem! In terms of web, what's the difference between a localhost and a remote server???
The problem is that JSF uses absolute URLs to rewrite the URI of a component, being it an image, a form action or else.. If there was a way to tell it to create relative paths, everything would be ok - as is the case with other frameworks, like Struts, JSP, etc.
>>what's the difference between a localhost and a remote server???

There's all the difference in the world. Localhost has no meaning to anything other than err...  the local host, so is not a good way to specify an address when your intentions span more than one machine. Use instead its hostname or IP address
All Courses

From novice to tech pro — start learning today.