title: nginx: configuration file /etc/nginx/nginx.conf test failed (host not found in upstream)
body: <p>I have a vagrant box that has been working fine for sometime and today for some reason I get the following when I attemp to restart nginx.</p>
  
  <pre><code>nginx: [emerg] host not found in upstream "www.myclass.com.192.168.33.10.xip.io" in /etc/nginx/conf.d/myclass.com.conf:19
  nginx: configuration file /etc/nginx/nginx.conf test failed
  </code></pre>
  
  <p>I've not changed anything myself as far as I know of (unless Windows Update has done something strange)</p>
  
  <p>Can anyone suggest how to get nginx working again &amp; allowing me to restart the nginx service - it would appear I cannot ping the host... any ideas why?</p>
  
  <p>Here is my nginx conf file:
  <a href="https://i.imgur.com/FmNYPKD.png" rel="noreferrer">nginx conf file</a></p>
  
  <p>--Update--
  Run the following to check what is on port 80.. (having read another similar post) and I can see that the varnish daemon is on port 80.. is this cause of the problem?? Any advice would be welcomed as I'm new to this stuff</p>
  
  <pre><code>sudo netstat -tlnp | grep 80
  </code></pre>
  
  <p>My myclass.com.conf file</p>
  
  <pre><code>server {
  listen              80;
  server_name         class.com.* www.class.com.*;
  
  root /vagrant/www.class.com/public_html;
  index index.php;
  
  access_log /vagrant/log/class.com.access.log;
  error_log  /vagrant/log/class.com.error.log error;
  
  charset utf-8;
  
  location = /favicon.ico { log_not_found off; access_log off; }
  location = /robots.txt  { access_log off; log_not_found off; }
  
  error_page 404 /index.php;
  
  location /socket.io {
      proxy_pass http://www.class.com.192.168.33.10.xip.io:8055;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
  }
  
  location / {
      try_files       $uri $uri/ @handler;
      expires         30d;
  }
  
  location  /. {
      return 404;
  }
  
  location @handler {
      rewrite / /index.php last;
  }
  
  location ~ .php/ {
      rewrite ^(.*.php)/ $1 last;
  }
  
  location ~ \.php$ {
      try_files                       $uri =404;
  
      expires                         off;
  
      fastcgi_read_timeout            900;
      fastcgi_index                   index.php;
      fastcgi_pass                    127.0.0.1:9000;
      fastcgi_param                   SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param                   CLASS_ENVIRONMENT LYLE;
      include                         /etc/nginx/fastcgi_params;
  }
  
  gzip            on;
  gzip_min_length 1000;
  gzip_proxied    any;
  gzip_types      text/plain application/xml text/css text/js application/x-javascript;
  
  sendfile        off;
  </code></pre>
  
  <p>}</p>