title: nginx configuration: IP address showing instead of domain name
body: <p>I put my website on a DigitalOcean Droplet and it worked. I called the IP address and it showed me the address, then I forwarded the domain to the website IP and it connected it.</p>
  
  <p>The issue at the beginning was that when I was accessing the website with my domain the access bar was showing my domain and when the page loaded it showed the IP address instead of the domain. </p>
  
  <p>it seemed that the issue was in my nginx configuration, as I wrote just my IP address there.</p>
  
  <pre><code>```
  server {
  listen 80;
  server_name 178.128.42.100;
  
  location = /favicon.ico { access_log off; log_not_found off; }
  location /static/ {
      root /home/patrik_website/patrik_web/form/;
  }
  
  location / {
      include proxy_params;
      proxy_pass http://unix:/run/gunicorn.sock;
  }
  }
  ```
  </code></pre>
  
  <p>I updated the file changing the server_name variable to:
      <code>
      server_name patrikmuniak.com www.patrikmuniak.com;
  </code>
  the lists in settings.py-ALLOWED_HOSTS=['*']
  and after the update to the nginx website configuration, this it's been restarted with:
      <code>
      sudo systemctl restart nginx
  </code>
  the output is that when I use any browser and type the IP or the domain, now it shows me the page with 'Welcome to nginx!'.</p>
  
  <p>The DNS records are:
  <a href="https://i.stack.imgur.com/tYexS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tYexS.jpg" alt="DNS records"></a></p>
  
  <p>and for forwarding I used the masking option.</p>
  
  <p>if you need more info please let me know. </p>
  
  <p>P.S. the OS is Ubuntu 19.04</p>