I have a Yeoman full-stack app @2.0.13 with the exact same directory structure as in this tutorial.
Everything works fine - grunt serve:dist
etc works without any errors. Now I want to go in production and deploy the app on a apache server as example.com/xxx
using mod_proxy
. I copy the grunt build
generated /dist
directory to a home directory and start up the server app :
NODE_ENV=production node server/app.js
The app starts up, populating users and so on. Everything works well. Now I setup virtual host settings for the node app :
<Location /html/xxx/>
ProxyPass http://127.0.0.1:9000/
ProxyPassReverse http://127.0.0.1:9000/
</Location>
This sort of works. The weird thing is, that index.html
from the dist directory is loaded correct
dist
├── public
│ ├── app
│ ├── assets
│ ├── bower_components
│ └─ index.html <---
|
└── server
├── api
├── auth
├── components
├── config
├── views
├─ app.js
└─ router.js
The proxyPass
works, index.html
is loaded - but the files index.html
is referring to (the 4 assembled public/app
files/ vendor.js
, app.js
and so on) is not. I get a 404
no matter what I have tried, no matter what setup from any guide I have tested
Have really spent many hours on this. To me it seems that the reverse proxy somehow alters the internal urls? The setup works if i replace dist/
with a node script that just listens on port 9000 and returns hello world.
What am I missing? Is there another way to do this?