Estou configurando o novo servidor Nginx que será usado como proxy reverso. Temos um servidor Debian mais antigo com o Apache instalado e funcionando. Neste servidor apache é site com acesso somente HTTPS eu quero esconder atrás do proxy.
A conexão do proxy ao upstream do Apache deve ser via HTTPS (os servidores estão em locais diferentes e o apache permite somente o acesso HTTPS).
Meu problema é que a conexão do Nginx para o Apache falha. Conexão normal do navegador para upstream sobre o trabalho HTTPS sem problemas. Conexão do mesmo proxy para os trabalhos upstream do Nginx. Quando o Nginx tenta se conectar à conexão do Apache upstream falha com o handshake de re-negociação falhando
Log do proxy Nginx (nível de depuração) diz apenas:
2016/04/07 15:51:08 [error] 5855#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 94.113.97.9, server: procrastination.com, request: "GET / HTTP/1.1", upstream: "https://77.240.191.234:443/", host: "procrastination.com"
Registre-se no Apache upstream:
[Thu Apr 07 15:36:48 2016] [info] Initial (No.1) HTTPS request received for child 35 (server procrastination.com:443)
[Thu Apr 07 15:36:48 2016] [debug] ssl_engine_kernel.c(421): [client 83.167.254.21] Reconfigured cipher suite will force renegotiation
[Thu Apr 07 15:36:48 2016] [info] [client 83.167.254.21] Requesting connection re-negotiation
[Thu Apr 07 15:36:48 2016] [debug] ssl_engine_kernel.c(764): [client 83.167.254.21] Performing full renegotiation: complete handshake protocol (client does support secure renegotiation)
[Thu Apr 07 15:36:48 2016] [info] [client 83.167.254.21] Awaiting re-negotiation handshake
[Thu Apr 07 15:36:58 2016] [error] [client 83.167.254.21] Re-negotiation handshake failed: Not accepted by client!?
Configuração do meu site Nginx no proxy:
server {
listen 80;
listen 443 ssl;
server_name procrastination.com *.procrastination.com;
###
# SSL
###
ssl on;
ssl_certificate /etc/ssl/localcerts/procrastination.com/fullchain.pem;
ssl_certificate_key /etc/ssl/localcerts/procrastination.com/privkey.pem;
##
# Logging Settings
##
access_log /var/log/nginx/procrastination_proxy-access.log;
error_log /var/log/nginx/procrastination_proxy-error.log debug;
include /etc/nginx/snippets/common;
include /etc/nginx/snippets/proxy_params;
location / {
proxy_pass https://brigita_https;
proxy_ssl_name $host;
}
}
Parte relacionada ao SSL do nginx.conf no proxy:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
Configuração do site Apache no envio de dados:
<VirtualHost 77.240.191.234:80>
ServerName procrastination.com
ServerAlias *.procrastination.com
DocumentRoot /var/www/procrastination-production/build/current/www
php_value newrelic.appname /var/www/procrastination-production/build/current/www
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L]
</VirtualHost>
<VirtualHost 77.240.191.234:443>
ServerName procrastination.com
ServerAlias *.procrastination.com
DocumentRoot /var/www/procrastination-production/build/current/www
php_value newrelic.appname /var/www/procrastination-production/build/current/www
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/ssl_procrastination_com.crt
SSLCertificateKeyFile /etc/apache2/ssl/ssl_procrastination_com.key
RewriteCond %{HTTP_HOST} !^www\..*$
RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L]
</VirtualHost>
Outros valores de configuração do Apache estão no padrão.
Alguma ideia de qual poderia ser a causa ou onde procurar mais dados de diagnóstico?