title: Connection Refused while deploying sentry server in Nginx
body: <p>Am using python sentry server for tracking logs of my website.And i have used nginx server to deploy it, my servers IP is xx.xx.xx.xx when i open this in browser it shows me <strong>502 Bad Gateway</strong> and when i checked the log it shows </p>
  
  <p>"<strong>connect() failed (111: Connection refused) while connecting to  upstream</strong>".</p>
  
  <p>Below is configuration i have used in NGINX ,</p>
  
  <pre><code>log_format timed_combined '$remote_addr - $remote_user [$time_local] '
      '"$request" $status $body_bytes_sent '
      '"$http_referer" "$http_user_agent" '
      '$request_time $upstream_response_time $pipe';
  
  server {
      listen 80;
      server_name xx.xx.xx.xx ;
      root /srv/www/name-sentry;
  
      location / {
          return 301 https://$host$request_uri;
      }
  }
  
  server {
      listen 443 default ssl;
  
      ssl on;
      ssl_certificate /etc/ssl/xx.xx.xx.xx/ssl.crt;
      ssl_certificate_key /etc/ssl/xx.xx.xx.xx/ssl.key;
  
      ssl_ciphers '';
      ssl_prefer_server_ciphers on;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_session_cache shared:SSL:10m;
      add_header Strict-Transport-Security "max-age=2592000; includeSubDomains";
  
      keepalive_timeout 0;
      # CHANGE ME: long timeout for ERP POST images
      proxy_read_timeout 200;
      proxy_send_timeout 200;
  
      server_name xx.xx.xx.xx ;
      root /srv/www/name-sentry;
      access_log /var/log/nginx/name-sentry-access.log timed_combined;
      error_log /var/log/nginx/name-sentry-error.log;
      error_page 502 /502.html;
      error_page 503 /503.html;
      error_page 504 /504.html;
  
  
      try_files $uri @name-sentry;
  
  
      location / {
  
          proxy_pass http://xx.xx.xx.xx;
          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;
  
          #proxy_set_header Host $http_host;
          #proxy_set_header X-Real-IP $remote_addr;
          #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          #proxy_set_header X-Forwarded-Protocol https;
          #add_header Access-Control-Allow-Origin "*";
          #add_header Access-Control-Allow-Credentials "true";
          #add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
          #add_header X-Backend-Server $hostname;
      }
  }
  </code></pre>
  
  <p>NOTE: xx.xx.xx.xx--is my IP.Command to start sentry server is "sentry start" and it works and sentry uses 9000 port.What is the solution of this ?</p>