Nginx:proxy_pass 被忽略

Nginx:proxy_pass 被忽略

我有以下服务器块:

server {

    listen 443;
    server_name cloud.example.com;

    ssl_certificate           /etc/ssl/certs/cloud.example.com/fullchain.pem;
    ssl_certificate_key       /etc/ssl/private/cloud.example.com/privkey.pem;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/cloud.log;
        client_max_body_size 300m;
    location / {

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_pass          https://cloud.example.com;
      proxy_read_timeout  90;
    }
  }

server {

    listen 886;
    server_name newcloud.example.com;

    ssl_certificate           /etc/ssl/certs/cloud.example.com/fullchain.pem;
    ssl_certificate_key       /etc/ssl/private/cloud.example.com/privkey.pem;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/newcloud.log;
        client_max_body_size 300m;
    location / {

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_pass          https://127.0.0.1:4443;
      proxy_read_timeout  90;
    }
  }

问题是当我尝试https://newcloud.example.com:886代理到 cloud.example.com(位于其他机器上)。它永远不会转到 127.0.0.1 端口 4443

我是否遗漏了什么?

相关内容