title: Connecting my domain name on digital ocean droplet
body: <p>I created a small hello world node app, then i hosted the app on digital ocean droplet, after that i can access my application on <a href="http://my_public_ip:3000" rel="noreferrer">http://my_public_ip:3000</a></p>
  
  <p>Felt happy </p>
  
  <p>Then i bought a domain name called <em>helloworld.tk</em> free domain from freenom.com
  After that i install nginx as a webserver in my droplet then i added a reverse proxy code in /etc/nginx/sites-enable/default</p>
  
  <p>My code looks like:</p>
  
  <pre><code>   server {
     listen 80;
     server_name helloworld.tk
  
     location / {
      proxy_pass http://localhost:3000;
     }
    }
  </code></pre>
  
  <p>After that i went to domain management panel in my freenom.com and set url forwarding to <a href="http://my_public_ip" rel="noreferrer">http://my_public_ip</a> </p>
  
  <p>So if i enter my domain name <em>helloworld.tk</em> in browser my node app successfully works  but wait what  my ip address is showing on left side below corner on chrome and if i refresh the page multiple times i get </p>
  
  <pre><code>   402 Too many request error page on nginx
  </code></pre>
  
  <p>So i deleted my url forwarding and in my domain management panel instead of url forwarding i set my nameservers like this ns1.digitalocean.com bla.bla.bla...</p>
  
  <p>Then i added my domain in my digitalocean panel. Now yes everything is working perfect.</p>
  
  <p>If i hit my url no ip address is showing, also no <em>too many request</em> errors </p>
  
  <p>My node app successfully getting executed!</p>
  
  <p>Wait i am a beginner for hosting node app, so i need help whether it is correct good setup for nodeapp on production? </p>
  
  <p>What is the difference between url forwarding and nameservers? Whether my nginx reverse proxy code is correct? is my reverse proxy working correctly?</p>
  
  <p>NOTE: I used pm2 for running node app on background.</p>