By Todd Brannon
Using correct port (‘3000’) and A and CNAME set to domain and ‘www’ alias, respectively. IP + port loads with no problem.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You need to setup apache web server as a reverse proxy for your nodejs web app so you can access it using the domain name, this is an example apache site for you to try it
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyPass "/" "http://localhost:3000"
ErrorLog ${APACHE_LOG_DIR}/nodejs_error.log
CustomLog ${APACHE_LOG_DIR}/nodejs_access.log combined
</VirtualHost>
Create a file called example.com.conf in /etc/apache2/sites-available/ with the above content, make sure to enable the proxy module and the new site with these commands
sudo a2enmod proxy
sudo a2ensite example.com.conf
sudo systemctl restart apache2
Now you can access your app using example.com as domain name.
Hope this helps
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.