Node.js routing with Apache proxy
<p>I'm running Apache on a Linux server and find that my node.js apps routing doesn't work correctly when using URLS that go through Apache.   </p>

<p>I followed instructions on other posts for turning on the proxy modules within apache and then set up this definition:</p>

<pre><code>ProxyPass /testauth http://localhost:3000/
</code></pre>

<p>(I also had a line in there to define a similar reverse proxy that did nothing)</p>

<p>My node app runs on port 3000 with routing set up like in app.js</p>

<pre><code>app.use('/', routes);
app.use('/tests', tests);
app.use('/questions', questions);
</code></pre>

<p>If I access URLs on my server like this:</p>

<pre><code>http://rose.cs.umass.edu:3000/
http://rose.cs.umass.edu:3000/questions/179
</code></pre>

<p>I get correct results (note the styling with some simple CSS)
If I try to access thru apache like this:</p>

<p><a href="http://rose.cs.umass.edu/testauth/questions/179" rel="nofollow">http://rose.cs.umass.edu/testauth/questions/179</a></p>

<p>I get a 404 error but see from the backtrace that it is inside my js code.<br>
For some reason the URL <a href="http://rose.cs.umass.edu/testauth" rel="nofollow">http://rose.cs.umass.edu/testauth</a> partially works (but CSS doesn't get applied (because the index.ejs file includes the css like this:  </p>

<pre><code>&lt;link rel='stylesheet' href='/stylesheets/style.css' /&gt;
</code></pre>

<p>The location of CSS files and the coding of relative paths follows all the node.js examples I have looked at and works fine in my development environment.   But when running the app by going thru Apache, things are not working right. 
Is there a fix to the apache config?  Do I have to make an adjustment to how code paths in the my javascript and ejs files?   </p>