Nginx redis服务器设置502网关错误
云上虚拟机Nginx redis服务器设置502网关错误,nginx,redis,openresty,Nginx,Redis,Openresty,云上虚拟机 我使用redis和openresty设置了这个nginx.conf文件 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_que
我使用redis和openresty设置了这个nginx.conf文件 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;
}
}
}
我运行这个conf作为
$nginx -p pwd/ -c my_nginx.conf
现在,当我在本地浏览器中访问这个虚拟机的ip地址时,我发现了一个错误
502坏网关
openresty/1.5.12.1
http://xxx.xxx.xxx.xxx:8080/
我哪里出错了
nginx-ppwd/-cmy\u nginx.conf-t
redis cli-p 6379
error.log
我测试了您的conf,它正常工作。这个问题似乎属于Stack Exchange网络中的另一个站点,因为它与编程无关。也许是。