title: How to run PrimeFaces behind reverse proxy in a subdomain?
body: <p>I have build an application with PrimeFaces and want to run that behind an apache reverse proxy.</p>
  
  <p>My target url looks like this <code>http://myserverurl.org:8080/myapplication/</code>.</p>
  
  <p>I want to access the application via subdomain like this <code>http://myapplication.myserverurl.org</code>.</p>
  
  <p>I have configured a VirtualHost in apache:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName myapplication.myserverurl.org
      ProxyPass / http://myserverurl.org:8080/myapplication/
      ProxyPassReverse / http://myserverurl.org:8080/myapplication/
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>That works not so well. I can see the JSF page, but there is no CSS applied etc. I can see that the first request is redirected correctly, but the following requests (to load jQuery, CSS, etc.) are not. </p>
  
  <p>They try to access an url like <code>http://myapplication.myserverurl.org/myapplication/faces/javax.faces.resource/primefaces.js?ln=primefaces</code> which is obviously wrong. They must not include the <strong>/myapplication/</strong> path again, since the proxy redirects already to that path.</p>
  
  <p>How can I solve this issue? Is this a PrimeFaces problem or a problem with my reverse proxy configuration?</p>