By m73mitchell
I’m using this tutorial https://www.digitalocean.com/community/articles/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab to setup a node site with nginx. It helps create a reverse proxy. this is what my nano /etc/nginx/conf.d/mydomain.com.conf looks like
server { listen 80;
server_name mydomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
The problem is that when I visit my domain, it’s redirecting to another domain that I have setup on the same server. I setup that other domain (a static page) using the nginx virtual hosts tutorial here https://www.digitalocean.com/community/articles/how-to-configure-single-and-multiple-wordpress-site-settings-with-nginx
One difference I noticed is that the nginx reverse proxy tutorial doesn’t do any of this symlinking between sites available and sites enabled which the virtual hosts tutorial does sudo ln -s /etc/nginx/sites-available/demo /etc/nginx/sites-enabled/demo
Do I have to somehow enable this file?
/etc/nginx/conf.d/mydomain.com.conf
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!
Try moving /etc/nginx/conf.d/mydomain.com.conf to /etc/nginx/sites-enabled, does that fix it?
Thanks, that cleared up the issues with the dns. Maybe that tutorial needs an update
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.