title: Deploying django app with nginx and uwsgi, client can not connect to server
body: <p>I have been trying to solve this problem three entire days without solution. Now, I am under pressure at my work and I really need your help.</p>
  
  <p>I know that nginx is listen to correct port '20154' using netstat, also I have run the command nginx -t and its ok. The logs have no error because client can not reach the server.</p>
  
  <p>Maybe the problem is with uwsgi.init I don't know, so I put here my cons files and uwsgi init files</p>
  
  <p>I hope can solve this problem with your help and solve this learning more.</p>
  
  <p><strong>nginx.conf file:</strong></p>
  
  <pre><code>user user;
  worker_processes 1;
  pid /var/run/nginx.pid;
  
  events {
      worker_connections 768;
      multi_accept on;
  }
  http {
  
      ##
      # Basic Settings
      ##
  
      sendfile on;
      tcp_nopush on;
      tcp_nodelay on;
      keepalive_timeout 65;
      types_hash_max_size 2048;
      # server_tokens off;
  
      # server_names_hash_bucket_size 64;
      # server_name_in_redirect off;
  
      include /etc/nginx/mime.types;
      default_type application/octet-stream;
  
      ##
      # Logging Settings
      ##
  
      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log;
  
      ##
      # Gzip Settings
      ##
      gzip on;
      gzip_disable "msie6";
  
      ##
      # nginx-naxsi config
      ##
      # Uncomment it if you installed nginx-naxsi
      ##
  
      #include /etc/nginx/naxsi_core.rules;
  
      ##
      # Virtual Host Configs
      ##
  
      include /etc/nginx/conf.d/*.conf;
      include /etc/nginx/sites-enabled/*;
  }
  </code></pre>
  
  <p><strong>nginx enabled sites</strong></p>
  
  <pre><code>upstream django {
     server unix:///home/ctag/env_Compass4D/Compass4D/Compass4D.sock; # for a file socket
  }
  server {
      listen 20154;         
  
      location /assets/ {
  
          root /home/ctag/env_Compass4D/Compass4D/;
  
      }
  
      location /doc/ {
          alias /usr/share/doc/;
          #alias /home/ctag/Compass4D/env_Compass4D/Compass4D
          autoindex on;
          #allow 127.0.0.1;
  
      }
      location / {
          #uwsgi_pass unix:/home/ctag/env_Compass4D/Compass4D/Compass4D.sock;
          proxy_pass            http://unix:/home/ctag/env_Compass4D/Compass4D/Compass4D.sock;
              #proxy_redirect        off;
              proxy_set_header      Host             $host;
              proxy_set_header      X-Real-IP        $remote_addr;
              proxy_set_header      X-Forwarded-For  $proxy_add_x_forwarded_for;
              client_max_body_size  10m;
          uwsgi_pass  django;
          include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
          }
      location /Compass4D {
                root /home/ctag/env_Compass4D/Compass4D/;
      }   
  </code></pre>
  
  <p><strong>uwsgi.init</strong></p>
  
  <pre><code># Compass4D_uwsgi.ini file
  [uwsgi]
  
  # Configuraciones Django
  # ruta al directorio del proyecto (ruta completa)
  chdir           = /home/ctag/env_Compass4D/Compass4D/
  # Archivo wsgi de Django
  module          = Compass4D.wsgi
  
  # master
  master          = true
  # numero de procesos (trabajadores)
  processes       = 5
  # Ruta al socket
  socket          = /home/ctag/env_Compass4D/Compass4D/Compass4D.sock
  # Permisos del socket
  chmod-socket    = 666
  
  # Loggeo para detectar fallo al startup
  #logto = /tmp/errlog
  
  # Al cerrar limpiar el ambiente
  vacuum          = true
  </code></pre>