Apache SSL 設定の背後にある nginx

Apache SSL 設定の背後にある nginx

私は、SSL 証明書付きの Web サイトをホストしている Apache Web サーバーを所有しています。そのサーバーは、SSL なしの Web サイト (nodejs) をホストしている nginx サーバーの前にあります。nginx でホストされているドメインにも SSL を設定したいのですが、方法がわかりません。nginx サーバーは次のように設定されています。

server {
    listen 8080;

    server_name example.com www.example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;  
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

}

apache2.conf は次のようになります:

<VirtualHost MYIPADDRESS:80>
        ServerName example.com
        ServerAlias *.example.com
        ErrorLog /var/www/httpd-logs/example.com.error.log
        ProxyPass / http://example.com:8080/
        ProxyPassReverse / http://example.com:8080/
        SSLProxyEngine On
        SSLProxyCheckPeerCN on
        SSLProxyCheckPeerExpire on
        ServerAdmin [email protected]
</VirtualHost>

いろいろ試してみましたが、結局は Apache がホストするドメインが壊れてしまいます。誰かが助けてくれることを願っています。

答え1

Apache を nginx に移動すると問題は解決しました。

関連情報