nginx 反向代理失败出现 Faithfully yours, nginx.

最近在学习nignx 反向代理的时候出现点问题:
问题描述 : 在测试nginx 反向代理时我使用我的云服务器上安装的tomcat,和windows 本地的tomcat 进行测试,(nginx 安装在我的云服务器)配置模式基本相同的,但是出现了我云服务器上的tomcat 访问成功但是,windows 上的tomcat 无法访问出现

nginx 配置 :

 listen       80;  
        server_name   云服务器ip;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location ~ /edu/ {
            proxy_pass  http://云服务器ip:8080;                
        }
        location ~ /vod/ {
           proxy_pass  http://windows电脑ip:8080;        
        }

测试: 单独使用 http://ip:8080/资源路径的方式 可以访问到 windows ,云服务器,中tomcat 的资源,

开启nginx

 使用 http://云服务器ip:80/edu/a.html

可以访问到a.html

 使用 http://window本机ip:80/vod/b.html

无法访问b.html,出现上图错误

查看nginx 错误日志(error.long)

021/05/06 20:06:48 [error] 4091#0: *82 upstream timed out (110: Connection timed out) while connecting to upstream, client: 223.104.176.247, server: 8.141.60.241, request: "GET /vod/b.html HTTP/1.1", upstream: "http://windows电脑ip:8080/vod/b.html", host: "云服务器ip"

我没有找到是哪里出现问题,是我配置出现问题了吗?希望有大神帮我解答一下!!!

阅读 15.8k
1 个回答
新手上路,请多包涵

在云服务器上测试 curl 云服务器ip/vod/

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题