SSL + proxy_pass = 404?

时间:2018-07-02 21:05:11

标签: ssl nginx http-status-code-404 reverse-proxy

每个人的收获。
nginx-1.13.8上配置Windows Server时遇到麻烦。 在reverse_proxy上添加SSL后,我收到404

工作配置(http):

server {
    listen      80;
    server_name example.com;

    location / {
        proxy_pass    http://192.168.0.3:80;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

使用ssl进行配置:

server {
    listen      443 ssl;
    server_name example.com;

    ssl                     on;
    ssl_certificate         ../cert/certcombined.crt;
    ssl_certificate_key     ../cert/private_rsa.key;


    location / {
        proxy_pass    http://192.168.0.3:80;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

192.168.0.3在Linux上是Apache
抱歉"broken english"

0 个答案:

没有答案