反向代理在nginx上的https上失败

llew8vvj  于 2023-05-28  发布在  Nginx
关注(0)|答案(1)|浏览(256)

我已经设置了一个vps重定向到中间件pc。中间件有windows nginx和is config

worker_processes  1;


events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    
    
    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

   
    server {
        listen       443;
        server_name 192.168.1.80:443;
        

         location / {
          
            proxy_pass https://192.168.1.80:443;
        }

        
    }

}

vps有这样配置的Debian

server { 
    listen 2323; 
    proxy_pass xxx.xxx.xxx.xxx:443;  (external ip of middle ware)

    #ssl_certificate /etc/nginx/cert.crt; 
    #ssl_certificate_key /etc/nginx/cert.key; 
} 

#
}

它通过http://xxx.xxx.xxx.xxx:2323连接192.168.1.80到目标的www.example.com。
但如果我尝试https:我需要用https连接
我错过了什么

v2g6jxz6

v2g6jxz61#

我看到你注解掉了这两行:#ssl_certificate/etc/nginx/cert. crt;#ssl_certificate_key /etc/nginx/证书密钥;请删除“#”符号并执行以下命令:

sudo systemctl restart nginx

为了进一步说明,请提供日志文件,包括access.log和error.log,位于/var/log/nginx/

相关问题