[Best practices?] If I'm running a droplet and want to use multiple urls for different node apps...?
-
I setup nginx and went through this:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-ltsAnd sort of went through this:
https://www.digitalocean.com/community/tutorials/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontabBut I messed around with the config.json file not realizing any better, but it kind of falls back on the port so I can still see my forum and but broke it and now it's having this error:
nevermind, see below
I have simple static files here showing up: http://www.violetcomics.com/
But for the forum I want the url not to show the port number and have it somewhere like http://www.violetcomics.com/forum or http://dev.violetcomics.com/forum and not have the gross port number show.
Note: I can restore a snapshot back to before installing nginx and messing up everything but is it possible to undo-EDIT - Nevermind: Snapshotted back.
Edit2: Installing nginx again...
Edit3: Re-installed nginx with one server block enabled (non-NodeBB-related), seen here: http://www.violetcomics.com/
-
You have had default /mynodebb/server.js and it should be /mynodebb/app.js. Error has gone so I guess you're up and running.
Just remember to restart nginx after changing config files.
-
@nhl.pl said:
You have had default /mynodebb/server.js and it should be /mynodebb/app.js. Error has gone so I guess you're up and running.
Just remember to restart nginx after changing config files.
Are you referring to "forever start --spinSleepTime 10000 main.js"? I had replaced "main" with "app" before restoring.
-
I restarted nginx, and do so whenever I try to make changes, but it's not working... Is something like this valid? I made sure the file in sites-available and sites-enabled are linked.
upstream io_nodes { ip_hash; server 127.0.0.1:4567; } server { listen 80; server_name forums.violetcomics.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_redirect off; # Socket.io Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; gzip on; gzip_min_length 1000; gzip_proxied off; gzip_types text/plain application/xml application/x-javascript text/css application/json; location @nodebb { proxy_pass http://io_nodes; } location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) { root /path/to/nodebb/public/; try_files $uri $uri/ @nodebb; } location / { proxy_pass http://io_nodes; } }
Edit: Error came back. @_@ I'll get back to it later.