nginx reverse proxy redirecting to wrong domain

I’m using this tutorial to setup a node site with nginx. It helps create a reverse proxy. this is what my nano /etc/nginx/conf.d/ looks like

server { listen 80;


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

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?


Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thanks, that cleared up the issues with the dns. Maybe that tutorial needs an update

Try moving /etc/nginx/conf.d/ to /etc/nginx/sites-enabled, does that fix it?