title: Nginx-redis server setup 502 bad gateway error
body: <p>on cloud VM<br>
  I set this nginx.conf file with redis and openresty</p>
  
  <p>my_nginx.conf -     </p>
  
  <pre><code>worker_processes 1;
  error_log logs/error.log;
  events{
      worker_connections 1024;
  }
  http {
   server {
       listen 8080; 
       location / {
         redis2_query set hello world;
         redis2_query get hello;
         redis2_pass 127.0.0.1:6379;
       }
    }
  }
  </code></pre>
  
  <p>I run this conf as </p>
  
  <pre><code>$nginx -p pwd/ -c my_nginx.conf
  </code></pre>
  
  <p>now when I visit the ip address of this vm in my local browser I get error </p>
  
  <p><code>502 bad gateway
  openresty/1.5.12.1</code></p>
  
  <p><code>http://xxx.xxx.xxx.xxx:8080/</code></p>
  
  <p>where am I making mistake?</p>