Estamos usando o Nginx como proxy reverso e gostaríamos que os visitantes do site baixassem um arquivo de um Blob do Azure
server {
listen 443;
ssl_certificate /sslcert/ssl.crt;
ssl_certificate_key /sslcert/com.key;
server_name get.domain.com;
location / {
proxy_redirect off;
proxy_pass http://oururl.blob.core.windows.net/;
}
No entanto, a HSTS não permite essa solicitação, pois o back-end está apresentando um certificado (?) com um nome comum diferente. Mesmo com o HSTS desativado, ainda veríamos um aviso sobre a autenticidade do host.
O que é curioso é que estamos usando proxy_pass para back-ends locais sem nenhum problema.
Trabalhos:
/home/user# curl get.domain.com
<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid.
Não funciona:
/home/user# curl https://get.domain.com
curl: (51) SSL: no alternative certificate subject name matches target host name 'get.domain.com'
E finalmente - sim, estamos cientes do recurso de mascaramento de subdomínio do Armazenamento do Azure. Nós não estamos usando porque estamos encaminhando nossos subdomínios para o Nginx IP para manuseio personalizado.
ATUALIZAÇÃO:
curl -k -v get.domain.com
* Hostname was NOT found in DNS cache
* Trying 140.17.8.10...
* Connected to get.domain.com (140.17.8.10) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-SHA384
* Server certificate:
* subject: CN=*.blob.core.windows.net
* start date: 2015-06-10 01:45:43 GMT
* expire date: 2017-06-09 01:45:43 GMT
* issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT SSL SHA2
* SSL certificate verify ok.
> GET /releases/RELEASES HTTP/1.1
> User-Agent: curl/7.35.0
> Host: get.domain.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 79
< Content-Type: application/octet-stream
< Content-MD5: IK8vn1QxUXipiqosdijfdA==
< Last-Modified: Tue, 05 Jan 2016 07:03:15 GMT
< ETag: 0x8D3159E48B72E88
* Server Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
< x-ms-request-id: XXXXXX-XXXXX-XXXXXXXXXXXX
< x-ms-version: 2009-09-19
< x-ms-lease-status: unlocked
< x-ms-blob-type: BlockBlob
< Date: Sat, 09 Jan 2016 06:46:43 GMT
<
* Connection #0 to host get.domain.com left intact
Tags ssl nginx azure reverse-proxy