title: How to listen nginx port 80 to django server?
body: <p>Why nginx run default page ? how to listen my django server ?</p>
  
  <p>First inside the <code>sites-availabe</code> folder i created <code>example.com</code> file then i </p>
  
  <pre><code>[root@instance-4 sites-available]# ls -al /etc/nginx/sites-enabled/example.com 
  lrwxrwxrwx. 1 root root 21 Dec 22 11:03 /etc/nginx/sites-enabled/example.com -&gt; example.com
  </code></pre>
  
  <p>/etc/nginx/sites-available/example.com</p>
  
  <pre><code>server {
          listen 80;
          server_name example.com;
  
          location / {
              proxy_pass http://127.0.0.1:8000;
              proxy_set_header Host $host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          }
  }
  </code></pre>
  
  <p>Then when i run <code>gunicorn example.wsgi</code> in my app folder and later i visited the <code>example.com</code> but you know what i am still getting nginx default page. </p>
  
  <p>What i am missing here ?</p>
  
  <p><strong>Updated :</strong></p>
  
  <p>Now this time i created example.com file in my Django root folder then after Symlink</p>
  
  <pre><code>[root@instance-4 Staging]# ln -s example.com /etc/nginx/sites-enabled/
  </code></pre>
  
  <p>after the nginx restart still same ...</p>
  
  <p><strong>Updated 2</strong> :</p>
  
  <p>nginx.conf file </p>
  
  <pre><code>user  nginx;
  worker_processes  1;
  
  error_log  /var/log/nginx/error.log warn;
  pid        /var/run/nginx.pid;
  
  
  events {
      worker_connections  1024;
  }
  
  
  http {
      include       /etc/nginx/mime.types;
      include /etc/nginx/sites-enabled/*;
      default_type  application/octet-stream;
  
      log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                        '$status $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';
  
      access_log  /var/log/nginx/access.log  main;
  
      sendfile        on;
      #tcp_nopush     on;
  
      keepalive_timeout  65;
  
      #gzip  on;
  
      include /etc/nginx/conf.d/*.conf;
  }
  </code></pre>