2

on cloud VM
I set this nginx.conf file with redis and openresty

my_nginx.conf -

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;
     }
  }
}

I run this conf as

$nginx -p pwd/ -c my_nginx.conf

now when I visit the ip address of this vm in my local browser I get error

502 bad gateway openresty/1.5.12.1

http://xxx.xxx.xxx.xxx:8080/

where am I making mistake?

pankaj udaas
  • 439
  • 2
  • 9
  • 14
  • 1
    This question appears to belong on another site in the Stack Exchange network because its not about programming. Perhaps [Super User](https://www.superuser.com/) or [Server Fault](http://serverfault.com/). – jww May 11 '14 at 11:32

1 Answers1

0
  1. make sure your nginx config is correct: nginx -p pwd/ -c my_nginx.conf -t
  2. make sure your redis server is working: redis-cli -p 6379.
  3. Check error.log.

I tested your conf and it works.

fannheyward
  • 18,599
  • 12
  • 71
  • 109