Sunday 14 February 2016

Can't configure Apache and Node to play nice

This may not be the correct place to post this but any help would be appreciated.I have a node app that works perfectly locally using the following directory structure:myapp/ app/ models/ routes.js config/ node_modules/ views/ package.json server.js I can load this app using http://localhost:8080 and all my routes work as expected. Example:app.get('/', function(req, res) { res.render('index.ejs'); }); app.get('/login', function(req, res) { res.render('login.ejs', { message: req.flash('loginMessage') }); }); I'm trying to deploy it to a DigitalOcean droplet that is already configured for LAMP. My directory structure is like this:var/ www/ html/ other HTML and JS apps/ myapp/ ... I have node up and running on the server. Loading either myurl.com:8080 or http://ift.tt/1REr6c2 renders the app landing page. However, all my of requests do not exist/404. For example, the /login request goes to myapp.com/login and 404's. I believe I may need to set up a ProxyPass in Apache but I can't seem to get it correct. I tried:ProxyPass /myapp/ http://localhost:8080/ which no longer resolves http://ift.tt/1REr6c2. I've tried a bunch of combinations with and without the /s but nothing seems to work.Any suggestions? Am I going down the wrong path? Thanks!

Submitted February 15, 2016 at 04:48AM by cmartin616

No comments:

Post a Comment